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 <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Mike Klein 2016-11-02 20:10:34 -04:00
parent 0d1708e6b7
commit 13078c8f33
7 changed files with 29 additions and 7 deletions

View File

@ -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,

View File

@ -77,6 +77,8 @@
},
{
"cmd": [
"python",
"-u",
"[CUSTOM_/_B_WORK]/skia/bin/fetch-gn"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",

View File

@ -83,6 +83,8 @@
},
{
"cmd": [
"python",
"-u",
"[CUSTOM_/_B_WORK]/skia/bin/fetch-gn"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",

View File

@ -77,6 +77,8 @@
},
{
"cmd": [
"python",
"-u",
"[CUSTOM_/_B_WORK]/skia/bin/fetch-gn"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",

View File

@ -77,6 +77,8 @@
},
{
"cmd": [
"python",
"-u",
"[CUSTOM_/_B_WORK]/skia/bin/fetch-gn"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",

View File

@ -77,6 +77,8 @@
},
{
"cmd": [
"python",
"-u",
"[CUSTOM_/_B_WORK]/skia/bin/fetch-gn"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",

View File

@ -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"
],