Index: PRESUBMIT.py |
diff --git a/PRESUBMIT.py b/PRESUBMIT.py |
index eac0a44a153012e122848d394137df8d02fda7c4..cf008ca8beb7945229c0e9ec71b99121a26fb47c 100644 |
--- a/PRESUBMIT.py |
+++ b/PRESUBMIT.py |
@@ -427,32 +427,37 @@ def _CheckGNCheck(input_api, output_api): |
import shutil |
shutil.rmtree(self.path) |
- with _TemporaryDirectory() as out_dir: |
- try: |
- input_api.subprocess.check_output(['gn', 'gen', out_dir]) |
- except input_api.subprocess.CalledProcessError, error: |
- return [output_api.PresubmitError( |
- 'gn gen must not fail.', long_text=error.output)] |
- |
- # TODO(eseidel): Currently only these are known to pass, |
- # once everything passes we can just call 'gn check' once without a filter! |
- KNOWN_PASSING = [ |
- '//examples/*', |
- '//mojo/*', |
- '//services/*', |
- '//shell/*', |
- ] |
- if input_api.platform != 'win32': |
- KNOWN_PASSING += [ |
- '//sky/*', |
- ] |
- for target_filter in KNOWN_PASSING: |
+ for target_os in [None, 'android']: |
+ with _TemporaryDirectory() as out_dir: |
try: |
- input_api.subprocess.check_output(['gn', 'check', out_dir, |
- target_filter]) |
+ command = ['gn', 'gen', out_dir] |
+ if target_os: |
+ command.append('--args=%s' % r'''os="android"''') |
+ input_api.subprocess.check_output(command) |
except input_api.subprocess.CalledProcessError, error: |
- error_title = 'gn check %s must not fail.' % target_filter |
- return [output_api.PresubmitError(error_title, long_text=error.output)] |
+ return [output_api.PresubmitError( |
+ 'gn gen must not fail.', long_text=error.output)] |
+ |
+ # TODO(eseidel): Currently only these are known to pass, once everything |
+ # passes we can just call 'gn check' once without a filter! |
+ KNOWN_PASSING = [ |
+ '//examples/*', |
+ '//mojo/*', |
+ '//services/*', |
+ '//shell/*', |
+ ] |
+ if input_api.platform != 'win32': |
+ KNOWN_PASSING += [ |
+ '//sky/*', |
+ ] |
+ for target_filter in KNOWN_PASSING: |
+ try: |
+ input_api.subprocess.check_output(['gn', 'check', out_dir, |
+ target_filter]) |
+ except input_api.subprocess.CalledProcessError, error: |
+ error_title = 'gn check %s must not fail.' % target_filter |
+ return [output_api.PresubmitError(error_title, |
+ long_text=error.output)] |
return [] |