Index: infra/bots/recipe_modules/skia/gn_flavor.py |
diff --git a/infra/bots/recipe_modules/skia/gn_flavor.py b/infra/bots/recipe_modules/skia/gn_flavor.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d3fb09957cef55da5a7e1e4fba148ae1be58af23 |
--- /dev/null |
+++ b/infra/bots/recipe_modules/skia/gn_flavor.py |
@@ -0,0 +1,35 @@ |
+# Copyright 2016 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import default_flavor |
+ |
+"""GN flavor utils, used for building Skia with GN.""" |
+class GNFlavorUtils(default_flavor.DefaultFlavorUtils): |
+ def compile(self, target): |
+ """Build Skia with GN.""" |
+ # Get the gn executable. |
+ fetch_gn = self._skia_api.skia_dir.join('bin', 'fetch_gn') |
+ self._skia_api.run(self._skia_api.m.step, 'fetch-gn', cmd=[fetch_gn], |
+ cwd=self._skia_api.skia_dir) |
+ |
+ out_dir = 'out/%s' % self._skia_api.configuration |
+ |
+ is_debug = 'is_debug=true' |
+ if self._skia_api.configuration != 'Debug': |
+ is_debug = 'is_debug=false' |
+ gn_args = [is_debug] |
+ |
+ # Run gn gen. |
+ gn_exe = 'gn' |
+ if self._skia_api.m.platform.is_win: |
+ gn_exe = 'gn.exe' |
+ gn_gen = [gn_exe, 'gen', out_dir, '--args=%s' % ' '.join(gn_args)] |
+ self._skia_api.run(self._skia_api.m.step, 'gn_gen', cmd=gn_gen, |
+ cwd=self._skia_api.skia_dir) |
+ |
+ # Run ninja. |
+ ninja_cmd = ['ninja', '-C', out_dir, 'skia'] |
mtklein
2016/07/27 20:06:31
Drop 'skia' so it builds everything? (Or is that
jcgregorio
2016/07/27 20:12:22
Done.
|
+ self._skia_api.run(self._skia_api.m.step, 'compile %s' % target, |
+ cmd=ninja_cmd, |
+ cwd=self._skia_api.skia_dir) |