From c1f9dfda254ebb2b1a38adf81baa45f4654c357f Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 5 Sep 2019 11:54:09 -0400 Subject: Make APPX build part of package command. Add nightly build for UWP. --- python/servo/build_commands.py | 78 +++--------------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-) (limited to 'python/servo/build_commands.py') diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 5c5cacdc48f..941a1b6fd97 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -249,15 +249,7 @@ class MachCommands(CommandBase): env["CXXFLAGS"] += "-mmacosx-version-min=10.10" if 'windows' in host: - vsinstalldir = os.environ.get('VSINSTALLDIR') - vcinstalldir = None - vs_version = os.environ.get('VisualStudioVersion') - if vsinstalldir and vs_version: - msbuild_version = get_msbuild_version(vs_version) - else: - (vsinstalldir, vs_version, msbuild_version) = find_highest_msvc_version() - msbuildinstalldir = os.path.join(vsinstalldir, "MSBuild", - msbuild_version, "Bin") + vs_dirs = self.vs_dirs() if host != target_triple and 'windows' in target_triple: if os.environ.get('VisualStudioVersion'): @@ -265,9 +257,9 @@ class MachCommands(CommandBase): "Please run `python mach build [arguments]` to bypass automatic " "Visual Studio shell.") sys.exit(1) - vcinstalldir = os.environ.get("VCINSTALLDIR", "") or os.path.join(vsinstalldir, "VC") + vcinstalldir = vs_dirs['vcdir'] if not os.path.exists(vcinstalldir): - print("Can't find Visual C++ %s installation at %s." % (vs_version, vcinstalldir)) + print("Can't find Visual C++ %s installation at %s." % (vs_dirs['vs_version'], vcinstalldir)) sys.exit(1) env['PKG_CONFIG_ALLOW_CROSS'] = "1" @@ -695,13 +687,9 @@ class MachCommands(CommandBase): # UWP app packaging already bundles all required DLLs for us. print("Packaging MSVC DLLs") - if not package_msvc_dlls(servo_exe_dir, target_triple, vcinstalldir, vs_version): + if not package_msvc_dlls(servo_exe_dir, target_triple, vs_dirs['vcdir'], vs_dirs['vs_version']): status = 1 - # UWP build hololens - if uwp and status == 0: - build_uwp_hololens(target_triple, dev, msbuildinstalldir) - elif sys.platform == "darwin": # On the Mac, set a lovely icon. This makes it easier to pick out the Servo binary in tools # like Instruments.app. @@ -907,33 +895,6 @@ def package_gstreamer_dlls(env, servo_exe_dir, target, uwp): return not missing -def build_uwp_hololens(target, dev, msbuild_dir): - # determine Visual studio Build Configuration (Debug/Release) and - # Build Platform (x64 vs arm64) - vs_platforms = { - "x86_64": "x64", - "i686": "x86", - "aarch64": "arm64", - } - target_arch = target.split('-')[0] - vs_platform = vs_platforms[target_arch] - - if dev: - Configuration = "Debug" - else: - Configuration = "Release" - - # execute msbuild - # Note: /m implies to use as many CPU cores as possible while building. - # msbuild /m /p:project=ServoApp .\support\hololens\servoapp.sln /p:SolutionDir=.\support\hololens - # /p:Configuration="Debug" /p:Platform="x64" /property:AppxBundle=Always;AppxBundlePlatforms="x64" - check_call([msbuild_dir + "\msbuild.exe", "/m", "/p:project=ServoApp", ".\support\hololens\ServoApp.sln", - "/p:SolutionDir=.\support\hololens", - "/p:Configuration=" + Configuration, - "/p:Platform=" + vs_platform, - "/p:AppxBundle=Always;AppxBundlePlatforms=" + vs_platform]) - - def package_msvc_dlls(servo_exe_dir, target, vcinstalldir, vs_version): # copy some MSVC DLLs to servo.exe dir msvc_redist_dir = None @@ -1002,34 +963,3 @@ def package_msvc_dlls(servo_exe_dir, target, vcinstalldir, vs_version): for msvc_dll in missing: print("DLL file `{}` not found!".format(msvc_dll)) return not missing - - -def get_msbuild_version(vs_version): - if vs_version in ("15.0", "14.0"): - msbuild_version = vs_version - else: - msbuild_version = "Current" - return msbuild_version - - -def find_highest_msvc_version(): - editions = ["Enterprise", "Professional", "Community", "BuildTools"] - prog_files = os.environ.get("ProgramFiles(x86)") - base_vs_path = os.path.join(prog_files, "Microsoft Visual Studio") - - vs_versions = ["2019", "2017"] - versions = { - ("2019", "vs"): "16.0", - ("2017", "vs"): "15.0", - } - - for version in vs_versions: - for edition in editions: - vs_version = versions[version, "vs"] - msbuild_version = get_msbuild_version(vs_version) - - vsinstalldir = os.path.join(base_vs_path, version, edition) - if os.path.exists(vsinstalldir): - return (vsinstalldir, vs_version, msbuild_version) - print("Can't find MSBuild.exe installation under %s." % base_vs_path) - sys.exit(1) -- cgit v1.2.3