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 json | 7 import json |
8 import sys | 8 import sys |
9 | 9 |
10 import bb_utils | 10 import bb_utils |
11 import bb_annotations | 11 import bb_annotations |
12 | 12 |
13 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | 13 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
14 from pylib import constants | 14 from pylib.constants import host_paths |
15 | 15 |
16 | 16 |
17 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') | 17 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') |
18 VALID_HOST_TESTS = set(['check_webview_licenses']) | 18 VALID_HOST_TESTS = set(['check_webview_licenses']) |
19 | 19 |
20 DIR_BUILD_ROOT = os.path.dirname(constants.DIR_SOURCE_ROOT) | 20 DIR_BUILD_ROOT = os.path.dirname(host_paths.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(host_paths.DIR_SOURCE_ROOT, *path) |
28 | 28 |
29 | 29 |
30 def CheckWebViewLicenses(_): | 30 def CheckWebViewLicenses(_): |
31 bb_annotations.PrintNamedStep('check_licenses') | 31 bb_annotations.PrintNamedStep('check_licenses') |
32 RunCmd([SrcPath('android_webview', 'tools', 'webview_licenses.py'), 'scan'], | 32 RunCmd([SrcPath('android_webview', 'tools', 'webview_licenses.py'), 'scan'], |
33 warning_code=1) | 33 warning_code=1) |
34 | 34 |
35 | 35 |
36 def RunHooks(build_type): | 36 def RunHooks(build_type): |
37 RunCmd([SrcPath('build', 'landmines.py')]) | 37 RunCmd([SrcPath('build', 'landmines.py')]) |
(...skipping 23 matching lines...) Expand all Loading... |
61 if options.build_targets: | 61 if options.build_targets: |
62 build_targets = options.build_targets.split(',') | 62 build_targets = options.build_targets.split(',') |
63 cmd += ['--build-args', ' '.join(build_targets)] | 63 cmd += ['--build-args', ' '.join(build_targets)] |
64 RunCmd(cmd, halt_on_failure=True, cwd=DIR_BUILD_ROOT) | 64 RunCmd(cmd, halt_on_failure=True, cwd=DIR_BUILD_ROOT) |
65 | 65 |
66 | 66 |
67 def ZipBuild(options): | 67 def ZipBuild(options): |
68 bb_annotations.PrintNamedStep('zip_build') | 68 bb_annotations.PrintNamedStep('zip_build') |
69 RunCmd([ | 69 RunCmd([ |
70 os.path.join(SLAVE_SCRIPTS_DIR, 'zip_build.py'), | 70 os.path.join(SLAVE_SCRIPTS_DIR, 'zip_build.py'), |
71 '--src-dir', constants.DIR_SOURCE_ROOT, | 71 '--src-dir', host_paths.DIR_SOURCE_ROOT, |
72 '--exclude-files', 'lib.target,gen,android_webview,jingle_unittests'] | 72 '--exclude-files', 'lib.target,gen,android_webview,jingle_unittests'] |
73 + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT) | 73 + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT) |
74 | 74 |
75 | 75 |
76 def ExtractBuild(options): | 76 def ExtractBuild(options): |
77 bb_annotations.PrintNamedStep('extract_build') | 77 bb_annotations.PrintNamedStep('extract_build') |
78 RunCmd([os.path.join(SLAVE_SCRIPTS_DIR, 'extract_build.py')] | 78 RunCmd([os.path.join(SLAVE_SCRIPTS_DIR, 'extract_build.py')] |
79 + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT) | 79 + bb_utils.EncodeProperties(options), cwd=DIR_BUILD_ROOT) |
80 | 80 |
81 | 81 |
82 def BisectPerfRegression(options): | 82 def BisectPerfRegression(options): |
83 args = [] | 83 args = [] |
84 if options.extra_src: | 84 if options.extra_src: |
85 args = ['--extra_src', options.extra_src] | 85 args = ['--extra_src', options.extra_src] |
86 RunCmd([SrcPath('tools', 'prepare-bisect-perf-regression.py'), | 86 RunCmd([SrcPath('tools', 'prepare-bisect-perf-regression.py'), |
87 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir)]) | 87 '-w', os.path.join(host_paths.DIR_SOURCE_ROOT, os.pardir)]) |
88 RunCmd([SrcPath('tools', 'run-bisect-perf-regression.py'), | 88 RunCmd([SrcPath('tools', 'run-bisect-perf-regression.py'), |
89 '-w', os.path.join(constants.DIR_SOURCE_ROOT, os.pardir), | 89 '-w', os.path.join(host_paths.DIR_SOURCE_ROOT, os.pardir), |
90 '--build-properties=%s' % json.dumps(options.build_properties)] + | 90 '--build-properties=%s' % json.dumps(options.build_properties)] + |
91 args) | 91 args) |
92 | 92 |
93 | 93 |
94 def GetHostStepCmds(): | 94 def GetHostStepCmds(): |
95 return [ | 95 return [ |
96 ('compile', Compile), | 96 ('compile', Compile), |
97 ('extract_build', ExtractBuild), | 97 ('extract_build', ExtractBuild), |
98 ('check_webview_licenses', CheckWebViewLicenses), | 98 ('check_webview_licenses', CheckWebViewLicenses), |
99 ('bisect_perf_regression', BisectPerfRegression), | 99 ('bisect_perf_regression', BisectPerfRegression), |
(...skipping 24 matching lines...) Expand all Loading... |
124 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 124 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
125 setattr(options, 'extra_src', | 125 setattr(options, 'extra_src', |
126 options.factory_properties.get('extra_src', '')) | 126 options.factory_properties.get('extra_src', '')) |
127 | 127 |
128 if options.steps: | 128 if options.steps: |
129 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) | 129 bb_utils.RunSteps(options.steps.split(','), GetHostStepCmds(), options) |
130 | 130 |
131 | 131 |
132 if __name__ == '__main__': | 132 if __name__ == '__main__': |
133 sys.exit(main(sys.argv)) | 133 sys.exit(main(sys.argv)) |
OLD | NEW |