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', 'lint']) |
18 EXPERIMENTAL_TARGETS = ['android_experimental'] | 18 EXPERIMENTAL_TARGETS = ['android_experimental'] |
19 | 19 |
20 DIR_BUILD_ROOT = os.path.dirname(constants.DIR_SOURCE_ROOT) | 20 DIR_BUILD_ROOT = os.path.dirname(constants.DIR_SOURCE_ROOT) |
21 | 21 |
22 # Short hand for RunCmd which is used extensively in this file. | 22 # Short hand for RunCmd which is used extensively in this file. |
23 RunCmd = bb_utils.RunCmd | 23 RunCmd = bb_utils.RunCmd |
24 | 24 |
25 | 25 |
26 def SrcPath(*path): | 26 def SrcPath(*path): |
27 return os.path.join(constants.DIR_SOURCE_ROOT, *path) | 27 return os.path.join(constants.DIR_SOURCE_ROOT, *path) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bb_annotations.PrintNamedStep('findbugs') | 91 bb_annotations.PrintNamedStep('findbugs') |
92 build_type = [] | 92 build_type = [] |
93 if options.target == 'Release': | 93 if options.target == 'Release': |
94 build_type = ['--release-build'] | 94 build_type = ['--release-build'] |
95 RunCmd([SrcPath('build', 'android', 'findbugs_diff.py')] + build_type) | 95 RunCmd([SrcPath('build', 'android', 'findbugs_diff.py')] + build_type) |
96 RunCmd([SrcPath( | 96 RunCmd([SrcPath( |
97 'tools', 'android', 'findbugs_plugin', 'test', | 97 'tools', 'android', 'findbugs_plugin', 'test', |
98 'run_findbugs_plugin_tests.py')] + build_type) | 98 'run_findbugs_plugin_tests.py')] + build_type) |
99 | 99 |
100 | 100 |
| 101 def Lint(options): |
| 102 bb_annotations.PrintNamedStep('lint') |
| 103 build_type = [] |
| 104 if options.target == 'Release': |
| 105 build_type = ['--release'] |
| 106 RunCmd([SrcPath('build', 'android', 'lint.py')] + build_type) |
| 107 |
| 108 |
101 def BisectPerfRegression(_): | 109 def BisectPerfRegression(_): |
102 RunCmd([SrcPath('tools', 'prepare-bisect-perf-regression.py'), | 110 RunCmd([SrcPath('tools', 'prepare-bisect-perf-regression.py'), |
103 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) | 111 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) |
104 RunCmd([SrcPath('tools', 'run-bisect-perf-regression.py'), | 112 RunCmd([SrcPath('tools', 'run-bisect-perf-regression.py'), |
105 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) | 113 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) |
106 | 114 |
107 | 115 |
108 def GetHostStepCmds(): | 116 def GetHostStepCmds(): |
109 return [ | 117 return [ |
110 ('compile', Compile), | 118 ('compile', Compile), |
111 ('extract_build', ExtractBuild), | 119 ('extract_build', ExtractBuild), |
112 ('check_webview_licenses', CheckWebViewLicenses), | 120 ('check_webview_licenses', CheckWebViewLicenses), |
113 ('bisect_perf_regression', BisectPerfRegression), | 121 ('bisect_perf_regression', BisectPerfRegression), |
114 ('findbugs', FindBugs), | 122 ('findbugs', FindBugs), |
| 123 ('lint', Lint), |
115 ('zip_build', ZipBuild) | 124 ('zip_build', ZipBuild) |
116 ] | 125 ] |
117 | 126 |
118 | 127 |
119 def GetHostStepsOptParser(): | 128 def GetHostStepsOptParser(): |
120 parser = bb_utils.GetParser() | 129 parser = bb_utils.GetParser() |
121 parser.add_option('--steps', help='Comma separated list of host tests.') | 130 parser.add_option('--steps', help='Comma separated list of host tests.') |
122 parser.add_option('--build-targets', default='All', | 131 parser.add_option('--build-targets', default='All', |
123 help='Comma separated list of build targets.') | 132 help='Comma separated list of build targets.') |
124 parser.add_option('--experimental', action='store_true', | 133 parser.add_option('--experimental', action='store_true', |
125 help='Indicate whether to compile experimental targets.') | 134 help='Indicate whether to compile experimental targets.') |
126 | 135 |
127 return parser | 136 return parser |
128 | 137 |
129 | 138 |
130 def main(argv): | 139 def main(argv): |
131 parser = GetHostStepsOptParser() | 140 parser = GetHostStepsOptParser() |
132 options, args = parser.parse_args(argv[1:]) | 141 options, args = parser.parse_args(argv[1:]) |
133 if args: | 142 if args: |
134 return sys.exit('Unused args %s' % args) | 143 return sys.exit('Unused args %s' % args) |
135 | 144 |
136 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 145 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
137 | 146 |
138 if options.steps: | 147 if options.steps: |
139 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) | 148 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) |
140 | 149 |
141 | 150 |
142 if __name__ == '__main__': | 151 if __name__ == '__main__': |
143 sys.exit(main(sys.argv)) | 152 sys.exit(main(sys.argv)) |
OLD | NEW |