From 13078c8f33fae639c2d60cc5cf65398f1d9465b1 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Wed, 2 Nov 2016 20:10:34 -0400 Subject: GN android flavor windows support GN is a .bat, fetch-gn is a Python script, ninja is an .exe. Just the same stuff gn_flavor does in the same way. TBR=borenet@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4321 Change-Id: I89ce3711a6dea46d32fe03c5719ef635defe54f7 Reviewed-on: https://skia-review.googlesource.com/4321 Commit-Queue: Mike Klein Reviewed-by: Mike Klein --- .../bots/recipe_modules/flavor/gn_android_flavor.py | 20 +++++++++++++++----- .../Build-Mac-Clang-mipsel-Debug-GN_Android.json | 2 ++ ...d-Ubuntu-Clang-arm64-Debug-GN_Android-Trybot.json | 2 ++ ...u-Clang-arm64-Debug-GN_Android_FrameworkDefs.json | 2 ++ .../Build-Ubuntu-Clang-arm64-Release-GN_Android.json | 2 ++ ...Ubuntu-Clang-arm64-Release-GN_Android_Vulkan.json | 2 ++ .../Build-Win-Clang-arm64-Release-GN_Android.json | 6 ++++-- 7 files changed, 29 insertions(+), 7 deletions(-) (limited to 'infra/bots') diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py index c31822bfe1..c409258134 100644 --- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py +++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py @@ -25,13 +25,21 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils): svg_dir = _data_dir + 'svgs', tmp_dir = _data_dir) - def _run(self, title, *cmd, **kwargs): + def _strip_environment(self): self.m.vars.default_env = {k: v for (k,v) in self.m.vars.default_env.iteritems() if k in ['PATH']} + + def _run(self, title, *cmd, **kwargs): + self._strip_environment() return self.m.run(self.m.step, title, cmd=list(cmd), cwd=self.m.vars.skia_dir, **kwargs) + def _py(self, title, script, infra_step=True): + self._strip_environment() + return self.m.run(self.m.python, title, script=script, + cwd=self.m.vars.skia_dir, env=None, infra_step=infra_step) + def _adb(self, title, *cmd, **kwargs): self._ever_ran_adb = True # The only non-infra adb steps (dm / nanobench) happen to not use _adb(). @@ -76,10 +84,12 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils): gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted(args.iteritems())) - self._run('fetch-gn', self.m.vars.skia_dir.join('bin', 'fetch-gn'), - infra_step=True) - self._run('gn gen', 'gn', 'gen', self.out_dir, '--args=' + gn_args) - self._run('ninja', 'ninja', '-C', self.out_dir) + gn = 'gn.bat' if 'Win' in os else 'gn' + ninja = 'ninja.exe' if 'Win' in os else 'ninja' + + self._py('fetch-gn', self.m.vars.skia_dir.join('bin', 'fetch-gn')) + self._run('gn gen', gn, 'gen', self.out_dir, '--args=' + gn_args) + self._run('ninja', ninja, '-C', self.out_dir) def install(self): self._adb('mkdir ' + self.device_dirs.resource_dir, diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-mipsel-Debug-GN_Android.json b/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-mipsel-Debug-GN_Android.json index 2686650a5b..c94230dc06 100644 --- a/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-mipsel-Debug-GN_Android.json +++ b/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-mipsel-Debug-GN_Android.json @@ -77,6 +77,8 @@ }, { "cmd": [ + "python", + "-u", "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" ], "cwd": "[CUSTOM_/_B_WORK]/skia", diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android-Trybot.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android-Trybot.json index ff457ac5bd..b09118c18c 100644 --- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android-Trybot.json +++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android-Trybot.json @@ -83,6 +83,8 @@ }, { "cmd": [ + "python", + "-u", "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" ], "cwd": "[CUSTOM_/_B_WORK]/skia", diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android_FrameworkDefs.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android_FrameworkDefs.json index 420b053486..6f01c2dff1 100644 --- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android_FrameworkDefs.json +++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Debug-GN_Android_FrameworkDefs.json @@ -77,6 +77,8 @@ }, { "cmd": [ + "python", + "-u", "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" ], "cwd": "[CUSTOM_/_B_WORK]/skia", diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android.json index 2878d41976..56d0d1c353 100644 --- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android.json +++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android.json @@ -77,6 +77,8 @@ }, { "cmd": [ + "python", + "-u", "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" ], "cwd": "[CUSTOM_/_B_WORK]/skia", diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android_Vulkan.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android_Vulkan.json index 1e36fd910b..cac1dd56bd 100644 --- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android_Vulkan.json +++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-arm64-Release-GN_Android_Vulkan.json @@ -77,6 +77,8 @@ }, { "cmd": [ + "python", + "-u", "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" ], "cwd": "[CUSTOM_/_B_WORK]/skia", diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Win-Clang-arm64-Release-GN_Android.json b/infra/bots/recipes/swarm_compile.expected/Build-Win-Clang-arm64-Release-GN_Android.json index c4fcc837ad..29d8c68170 100644 --- a/infra/bots/recipes/swarm_compile.expected/Build-Win-Clang-arm64-Release-GN_Android.json +++ b/infra/bots/recipes/swarm_compile.expected/Build-Win-Clang-arm64-Release-GN_Android.json @@ -77,6 +77,8 @@ }, { "cmd": [ + "python", + "-u", "[CUSTOM_C:\\_B_WORK]\\skia\\bin\\fetch-gn" ], "cwd": "[CUSTOM_C:\\_B_WORK]\\skia", @@ -87,7 +89,7 @@ }, { "cmd": [ - "gn", + "gn.bat", "gen", "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-Clang-arm64-Release-GN_Android\\Release", "--args=is_debug=false ndk=\"[SLAVE_BUILD]\\n\" target_cpu=\"arm64\"" @@ -100,7 +102,7 @@ }, { "cmd": [ - "ninja", + "ninja.exe", "-C", "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-Clang-arm64-Release-GN_Android\\Release" ], -- cgit v1.2.3