Skip to content

Commit

Permalink
Add CI artifacts and nightly build for UWP.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Sep 6, 2019
1 parent c7a6722 commit eb01f4f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 18 deletions.
32 changes: 29 additions & 3 deletions etc/taskcluster/decision_task.py
Expand Up @@ -55,7 +55,7 @@ def main(task_for):

"try-mac": [macos_unit],
"try-linux": [linux_tidy_unit_docs, linux_release],
"try-windows": [windows_unit, windows_arm64, windows_uwp_x64],
"try-windows": [windows_unit, windows_arm64, windows_uwp_x64, uwp_nightly],
"try-magicleap": [magicleap_dev],
"try-arm": [windows_arm64],
"try-wpt": [linux_wpt],
Expand Down Expand Up @@ -92,6 +92,7 @@ def main(task_for):
macos_nightly()
update_wpt()
magicleap_nightly()
uwp_nightly()


# These are disabled in a "real" decision task,
Expand Down Expand Up @@ -377,7 +378,11 @@ def windows_arm64():
return (
windows_build_task("UWP dev build", arch="arm64", package=False)
.with_treeherder("Windows arm64")
.with_script("python mach build --dev --uwp --win-arm64")
.with_script("""
python mach build --dev --uwp --win-arm64
python mach package --dev --target aarch64-pc-windows-msvc --uwp=arm64
""")
.with_artifacts('repo/support/hololens/AppPackages/ServoApp/ServoApp_1.0.0.0_Test/ServoApp_1.0.0.0_arm64.appxbundle')
.find_or_create("build.windows_uwp_arm64_dev." + CONFIG.task_id())
)

Expand All @@ -386,11 +391,32 @@ def windows_uwp_x64():
return (
windows_build_task("UWP dev build", package=False)
.with_treeherder("Windows x64")
.with_script("mach build --dev --uwp")
.with_script("""
mach build --dev --uwp
mach package --dev --uwp=x64
""")
.with_artifacts('repo/support/hololens/AppPackages/ServoApp/ServoApp_1.0.0.0_Test/ServoApp_1.0.0.0_x64.appxbundle')
.find_or_create("build.windows_uwp_x64_dev." + CONFIG.task_id())
)


def uwp_nightly():
return (
windows_build_task("Nightly build and upload", package=False)
.with_treeherder("Windows x64", "UWP Nightly")
#.with_features("taskclusterProxy")
#.with_scopes("secrets:get:project/servo/s3-upload-credentials")
.with_script("""
mach build --release --uwp
python mach build --release --uwp --win-arm64
mach package --release --uwp=x64 --uwp=arm64
#mach upload-nightly uwp --secret-from-taskcluster
""")
.with_artifacts('repo/support/hololens/AppPackages/ServoApp/ServoApp_1.0.0.0_Test/ServoApp_1.0.0.0_x64_arm64.appxbundle')
.find_or_create("build.windows_uwp_nightlies." + CONFIG.task_id())
)


def windows_unit():
return (
windows_build_task("Dev build + unit tests")
Expand Down
31 changes: 16 additions & 15 deletions python/servo/package_commands.py
Expand Up @@ -67,6 +67,9 @@
r'target\release\msi\Servo.exe',
r'target\release\msi\Servo.zip',
],
'uwp': [
r'support\hololens\AppPackages\ServoApp\ServoApp_1.0.0.0_Test\ServoApp_1.0.0.0_x64_arm64.appxbundle',
],
}


Expand Down Expand Up @@ -204,9 +207,10 @@ class PackageCommands(CommandBase):
help='Create a local Maven repository')
@CommandArgument('--uwp',
default=None,
action='append',
help='Create an APPX package')
def package(self, release=False, dev=False, android=None, magicleap=None, debug=False,
debugger=None, target=None, flavor=None, maven=False, uwp=False):
debugger=None, target=None, flavor=None, maven=False, uwp=None):
if android is None:
android = self.config["build"]["android"]
if target and android:
Expand All @@ -222,12 +226,12 @@ def package(self, release=False, dev=False, android=None, magicleap=None, debug=
if magicleap:
target = "aarch64-linux-android"
env = self.build_env(target=target)
binary_path = self.get_binary_path(release, dev, target=target, android=android, magicleap=magicleap)
binary_path = self.get_binary_path(release, dev, target=target, android=android, magicleap=magicleap, simpleservo=uwp is not None)
dir_to_root = self.get_top_dir()
target_dir = path.dirname(binary_path)
if uwp:
vs_info = self.vs_dirs()
build_uwp(target or 'x86_64-pc-windows-msvc', dev, vs_info['msbuild'])
build_uwp(uwp, dev, vs_info['msbuild'])
elif magicleap:
if platform.system() not in ["Darwin"]:
raise Exception("Magic Leap builds are only supported on macOS.")
Expand Down Expand Up @@ -732,16 +736,13 @@ def call_git(cmd, **kwargs):
return 0


def build_uwp(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]
def build_uwp(platforms, dev, msbuild_dir):
if any(lambda p: p not in ['x64', 'x86', 'arm64'], platforms):
raise Exception("Unsupported appx platforms: " + str(platforms))
if dev and len(platforms) > 1:
raise Exception("Debug package with multiple architectures is unsupported")

platforms = platforms.join('|')

if dev:
Configuration = "Debug"
Expand All @@ -755,5 +756,5 @@ def build_uwp(target, dev, msbuild_dir):
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])
"/p:Platform=" + platforms,
"/p:AppxBundle=Always;AppxBundlePlatforms=" + platforms])

0 comments on commit eb01f4f

Please sign in to comment.