Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: PRESUBMIT.py

Issue 808703005: Run gn check for an android build on presubmit (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | examples/device_name/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 []
« no previous file with comments | « no previous file | examples/device_name/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698