OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 import bb_utils | 9 import bb_utils |
10 import bb_annotations | 10 import bb_annotations |
11 | 11 |
12 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | 12 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
13 from pylib import constants | 13 from pylib import constants |
14 | 14 |
15 | 15 |
16 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') | 16 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') |
17 VALID_HOST_TESTS = set(['check_webview_licenses', 'findbugs']) | 17 VALID_HOST_TESTS = set(['check_webview_licenses', 'findbugs']) |
18 EXPERIMENTAL_TARGETS = ['android_experimental'] | |
19 | 18 |
20 DIR_BUILD_ROOT = os.path.dirname(constants.DIR_SOURCE_ROOT) | 19 DIR_BUILD_ROOT = os.path.dirname(constants.DIR_SOURCE_ROOT) |
21 | 20 |
22 # Short hand for RunCmd which is used extensively in this file. | 21 # Short hand for RunCmd which is used extensively in this file. |
23 RunCmd = bb_utils.RunCmd | 22 RunCmd = bb_utils.RunCmd |
24 | 23 |
25 | 24 |
26 def SrcPath(*path): | 25 def SrcPath(*path): |
27 return os.path.join(constants.DIR_SOURCE_ROOT, *path) | 26 return os.path.join(constants.DIR_SOURCE_ROOT, *path) |
28 | 27 |
(...skipping 27 matching lines...) Expand all Loading... | |
56 '--build-tool=ninja', | 55 '--build-tool=ninja', |
57 '--compiler=goma', | 56 '--compiler=goma', |
58 '--target=%s' % options.target, | 57 '--target=%s' % options.target, |
59 '--goma-dir=%s' % bb_utils.GOMA_DIR] | 58 '--goma-dir=%s' % bb_utils.GOMA_DIR] |
60 build_targets = options.build_targets.split(',') | 59 build_targets = options.build_targets.split(',') |
61 bb_annotations.PrintNamedStep('compile') | 60 bb_annotations.PrintNamedStep('compile') |
62 for build_target in build_targets: | 61 for build_target in build_targets: |
63 RunCmd(cmd + ['--build-args=%s' % build_target], | 62 RunCmd(cmd + ['--build-args=%s' % build_target], |
64 halt_on_failure=True, | 63 halt_on_failure=True, |
65 cwd=DIR_BUILD_ROOT) | 64 cwd=DIR_BUILD_ROOT) |
66 if options.experimental: | |
67 for compile_target in EXPERIMENTAL_TARGETS: | |
68 bb_annotations.PrintNamedStep('Experimental Compile %s' % compile_target) | |
69 RunCmd(cmd + ['--build-args=%s' % compile_target], | |
70 flunk_on_failure=False, | |
71 cwd=DIR_BUILD_ROOT) | |
72 | 65 |
73 | 66 |
74 def ZipBuild(options): | 67 def ZipBuild(options): |
75 bb_annotations.PrintNamedStep('zip_build') | 68 bb_annotations.PrintNamedStep('zip_build') |
76 RunCmd([ | 69 RunCmd([ |
77 os.path.join(SLAVE_SCRIPTS_DIR, 'zip_build.py'), | 70 os.path.join(SLAVE_SCRIPTS_DIR, 'zip_build.py'), |
78 '--src-dir', constants.DIR_SOURCE_ROOT, | 71 '--src-dir', constants.DIR_SOURCE_ROOT, |
79 '--exclude-files', 'lib.target,gen,android_webview,jingle_unittests'] | 72 '--exclude-files', 'lib.target,gen,android_webview,jingle_unittests'] |
80 + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT) | 73 + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT) |
81 | 74 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 ('findbugs', FindBugs), | 107 ('findbugs', FindBugs), |
115 ('zip_build', ZipBuild) | 108 ('zip_build', ZipBuild) |
116 ] | 109 ] |
117 | 110 |
118 | 111 |
119 def GetHostStepsOptParser(): | 112 def GetHostStepsOptParser(): |
120 parser = bb_utils.GetParser() | 113 parser = bb_utils.GetParser() |
121 parser.add_option('--steps', help='Comma separated list of host tests.') | 114 parser.add_option('--steps', help='Comma separated list of host tests.') |
122 parser.add_option('--build-targets', default='All', | 115 parser.add_option('--build-targets', default='All', |
123 help='Comma separated list of build targets.') | 116 help='Comma separated list of build targets.') |
124 parser.add_option('--experimental', action='store_true', | 117 parser.add_option('--experimental', action='store_true', |
Isaac (away)
2014/01/22 23:37:02
Delete option too? IDK
Nico
2014/01/22 23:41:03
As far as I can tell, a flag with the same name is
| |
125 help='Indicate whether to compile experimental targets.') | 118 help='Indicate whether to compile experimental targets.') |
126 | 119 |
127 return parser | 120 return parser |
128 | 121 |
129 | 122 |
130 def main(argv): | 123 def main(argv): |
131 parser = GetHostStepsOptParser() | 124 parser = GetHostStepsOptParser() |
132 options, args = parser.parse_args(argv[1:]) | 125 options, args = parser.parse_args(argv[1:]) |
133 if args: | 126 if args: |
134 return sys.exit('Unused args %s' % args) | 127 return sys.exit('Unused args %s' % args) |
135 | 128 |
136 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 129 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
137 | 130 |
138 if options.steps: | 131 if options.steps: |
139 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) | 132 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) |
140 | 133 |
141 | 134 |
142 if __name__ == '__main__': | 135 if __name__ == '__main__': |
143 sys.exit(main(sys.argv)) | 136 sys.exit(main(sys.argv)) |
OLD | NEW |