OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import re | 5 import re |
6 | 6 import manual_bisect_files |
7 from recipe_engine import recipe_api | 7 from recipe_engine import recipe_api |
8 | 8 |
9 | 9 |
10 # TODO(machenbach): Chromium specific data should move out of the archive | 10 # TODO(machenbach): Chromium specific data should move out of the archive |
11 # module, into e.g. the chromium test configs. | 11 # module, into e.g. the chromium test configs. |
12 EXCLUDED_FILES_ALL_PLATFORMS = [ | 12 EXCLUDED_FILES_ALL_PLATFORMS = [ |
13 '.landmines', | 13 '.landmines', |
14 '.ninja_deps', | 14 '.ninja_deps', |
15 '.ninja_log', | 15 '.ninja_log', |
16 'gen', | 16 'gen', |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 | 82 |
83 class ArchiveApi(recipe_api.RecipeApi): | 83 class ArchiveApi(recipe_api.RecipeApi): |
84 """Chromium specific module for zipping, uploading and downloading build | 84 """Chromium specific module for zipping, uploading and downloading build |
85 artifacts implemented as a wrapper around zip_build.py script. | 85 artifacts implemented as a wrapper around zip_build.py script. |
86 | 86 |
87 If you need to upload or download build artifacts (or any other files) for | 87 If you need to upload or download build artifacts (or any other files) for |
88 something other than Chromium flavor, consider using 'zip' + 'gsutil' or | 88 something other than Chromium flavor, consider using 'zip' + 'gsutil' or |
89 'isolate' modules instead. | 89 'isolate' modules instead. |
90 """ | 90 """ |
91 | |
92 def zip_and_upload_build( | 91 def zip_and_upload_build( |
93 self, step_name, target, build_url=None, src_dir=None, | 92 self, step_name, target, build_url=None, src_dir=None, |
94 build_revision=None, cros_board=None, package_dsym_files=False, | 93 build_revision=None, cros_board=None, package_dsym_files=False, |
95 exclude_files=None, **kwargs): | 94 exclude_files=None, exclude_perf_test_files=False, |
| 95 update_properties=None, store_by_hash=True, **kwargs): |
96 """Returns a step invoking zip_build.py to zip up a Chromium build. | 96 """Returns a step invoking zip_build.py to zip up a Chromium build. |
97 If build_url is specified, also uploads the build.""" | 97 If build_url is specified, also uploads the build.""" |
98 if not src_dir: | 98 if not src_dir: |
99 src_dir = self.m.path['checkout'] | 99 src_dir = self.m.path['checkout'] |
100 args = [ | 100 args = [ |
101 '--show-path', | 101 '--show-path', |
102 'python', | 102 'python', |
103 self.package_repo_resource('scripts', 'slave', 'zip_build.py'), | 103 self.package_repo_resource('scripts', 'slave', 'zip_build.py'), |
104 '--target', target, | 104 '--target', target, |
105 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path, | 105 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path, |
106 '--staging-dir', self.m.path['cache'].join('chrome_staging'), | 106 '--staging-dir', self.m.path['cache'].join('chrome_staging'), |
107 '--src-dir', src_dir, | 107 '--src-dir', src_dir, |
108 ] | 108 ] |
109 if 'build_archive_url' in self.m.properties: | 109 if 'build_archive_url' in self.m.properties: |
110 args.extend(['--use-build-url-name', '--build-url', | 110 args.extend(['--use-build-url-name', '--build-url', |
111 self.m.properties['build_archive_url']]) | 111 self.m.properties['build_archive_url']]) |
112 elif build_url: | 112 elif build_url: |
113 args.extend(['--build-url', build_url]) | 113 args.extend(['--build-url', build_url]) |
114 if build_revision: | 114 if build_revision: |
115 args.extend(['--build_revision', build_revision]) | 115 args.extend(['--build_revision', build_revision]) |
116 if cros_board: | 116 if cros_board: |
117 args.extend(['--cros-board', cros_board]) | 117 args.extend(['--cros-board', cros_board]) |
118 if package_dsym_files: | 118 if package_dsym_files: |
119 args.append('--package-dsym-files') | 119 args.append('--package-dsym-files') |
120 if exclude_files: | 120 if exclude_files: |
121 args.extend(['--exclude-files', exclude_files]) | 121 args.extend(['--exclude-files', exclude_files]) |
122 if 'gs_acl' in self.m.properties: | 122 if 'gs_acl' in self.m.properties: |
123 args.extend(['--gs-acl', self.m.properties['gs_acl']]) | 123 args.extend(['--gs-acl', self.m.properties['gs_acl']]) |
| 124 if exclude_perf_test_files: |
| 125 inclusions = ','.join(manual_bisect_files.CHROME_REQUIRED_FILES) |
| 126 strip_files = ','.join(manual_bisect_files.CHROME_STRIP_LIST) |
| 127 args.extend(['--include-files', inclusions]) |
| 128 args.extend(['--ignore-regex']) |
| 129 args.extend(['--strip-files', strip_files]) |
| 130 # If update_properties is passed in and store_by_hash is False, |
| 131 # we store it with commit position number instead of a hash |
| 132 if update_properties and not store_by_hash: |
| 133 commit_position = self._get_commit_position( |
| 134 update_properties, None) |
| 135 cp_branch, cp_number = self.m.commit_position.parse(commit_position) |
| 136 args.extend(['--build_revision', cp_number]) |
124 | 137 |
125 properties_json = self.m.json.dumps(self.m.properties.legacy()) | 138 properties_json = self.m.json.dumps(self.m.properties.legacy()) |
126 args.extend(['--factory-properties', properties_json, | 139 args.extend(['--factory-properties', properties_json, |
127 '--build-properties', properties_json]) | 140 '--build-properties', properties_json]) |
128 | 141 |
129 kwargs['allow_subannotations'] = True | 142 kwargs['allow_subannotations'] = True |
130 self.m.python( | 143 self.m.python( |
131 step_name, | 144 step_name, |
132 self.package_repo_resource('scripts', 'tools', 'runit.py'), | 145 self.package_repo_resource('scripts', 'tools', 'runit.py'), |
133 args, | 146 args, |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 def legacy_download_url(self, gs_bucket_name, extra_url_components=None): | 425 def legacy_download_url(self, gs_bucket_name, extra_url_components=None): |
413 """Returns a url suitable for downloading a Chromium build from | 426 """Returns a url suitable for downloading a Chromium build from |
414 Google Storage. | 427 Google Storage. |
415 | 428 |
416 extra_url_components, if specified, should be a string without a | 429 extra_url_components, if specified, should be a string without a |
417 trailing '/' which is inserted in the middle of the URL. | 430 trailing '/' which is inserted in the middle of the URL. |
418 | 431 |
419 The builder_name, or parent_buildername, is always automatically | 432 The builder_name, or parent_buildername, is always automatically |
420 inserted into the URL.""" | 433 inserted into the URL.""" |
421 return self._legacy_url(True, gs_bucket_name, extra_url_components) | 434 return self._legacy_url(True, gs_bucket_name, extra_url_components) |
OLD | NEW |