| 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 import sys |
| 7 |
| 6 import manual_bisect_files | 8 import manual_bisect_files |
| 7 from recipe_engine import recipe_api | 9 from recipe_engine import recipe_api |
| 8 | 10 |
| 9 | 11 |
| 10 # TODO(machenbach): Chromium specific data should move out of the archive | 12 # TODO(machenbach): Chromium specific data should move out of the archive |
| 11 # module, into e.g. the chromium test configs. | 13 # module, into e.g. the chromium test configs. |
| 12 EXCLUDED_FILES_ALL_PLATFORMS = [ | 14 EXCLUDED_FILES_ALL_PLATFORMS = [ |
| 13 '.landmines', | 15 '.landmines', |
| 14 '.ninja_deps', | 16 '.ninja_deps', |
| 15 '.ninja_log', | 17 '.ninja_log', |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 artifacts implemented as a wrapper around zip_build.py script. | 87 artifacts implemented as a wrapper around zip_build.py script. |
| 86 | 88 |
| 87 If you need to upload or download build artifacts (or any other files) for | 89 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 | 90 something other than Chromium flavor, consider using 'zip' + 'gsutil' or |
| 89 'isolate' modules instead. | 91 'isolate' modules instead. |
| 90 """ | 92 """ |
| 91 def zip_and_upload_build( | 93 def zip_and_upload_build( |
| 92 self, step_name, target, build_url=None, src_dir=None, | 94 self, step_name, target, build_url=None, src_dir=None, |
| 93 build_revision=None, cros_board=None, package_dsym_files=False, | 95 build_revision=None, cros_board=None, package_dsym_files=False, |
| 94 exclude_files=None, exclude_perf_test_files=False, | 96 exclude_files=None, exclude_perf_test_files=False, |
| 95 update_properties=None, store_by_hash=True, **kwargs): | 97 update_properties=None, store_by_hash=True, |
| 98 platform=None, **kwargs): |
| 96 """Returns a step invoking zip_build.py to zip up a Chromium build. | 99 """Returns a step invoking zip_build.py to zip up a Chromium build. |
| 97 If build_url is specified, also uploads the build.""" | 100 If build_url is specified, also uploads the build.""" |
| 98 if not src_dir: | 101 if not src_dir: |
| 99 src_dir = self.m.path['checkout'] | 102 src_dir = self.m.path['checkout'] |
| 100 args = [ | 103 args = [ |
| 101 '--show-path', | 104 '--show-path', |
| 102 'python', | 105 'python', |
| 103 self.package_repo_resource('scripts', 'slave', 'zip_build.py'), | 106 self.package_repo_resource('scripts', 'slave', 'zip_build.py'), |
| 104 '--target', target, | 107 '--target', target, |
| 105 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path, | 108 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path, |
| 106 '--staging-dir', self.m.path['cache'].join('chrome_staging'), | 109 '--staging-dir', self.m.path['cache'].join('chrome_staging'), |
| 107 '--src-dir', src_dir, | 110 '--src-dir', src_dir, |
| 108 ] | 111 ] |
| 109 if 'build_archive_url' in self.m.properties: | 112 if 'build_archive_url' in self.m.properties: |
| 110 args.extend(['--use-build-url-name', '--build-url', | 113 args.extend(['--use-build-url-name', '--build-url', |
| 111 self.m.properties['build_archive_url']]) | 114 self.m.properties['build_archive_url']]) |
| 112 elif build_url: | 115 elif build_url: |
| 113 args.extend(['--build-url', build_url]) | 116 args.extend(['--build-url', build_url]) |
| 114 if build_revision: | 117 if build_revision: |
| 115 args.extend(['--build_revision', build_revision]) | 118 args.extend(['--build_revision', build_revision]) |
| 116 if cros_board: | 119 if cros_board: |
| 117 args.extend(['--cros-board', cros_board]) | 120 args.extend(['--cros-board', cros_board]) |
| 118 if package_dsym_files: | 121 if package_dsym_files: |
| 119 args.append('--package-dsym-files') | 122 args.append('--package-dsym-files') |
| 120 if exclude_files: | 123 if exclude_files: |
| 121 args.extend(['--exclude-files', exclude_files]) | 124 args.extend(['--exclude-files', exclude_files]) |
| 122 if 'gs_acl' in self.m.properties: | 125 if 'gs_acl' in self.m.properties: |
| 123 args.extend(['--gs-acl', self.m.properties['gs_acl']]) | 126 args.extend(['--gs-acl', self.m.properties['gs_acl']]) |
| 124 if exclude_perf_test_files: | 127 if exclude_perf_test_files and platform: |
| 125 inclusions = ','.join(manual_bisect_files.CHROME_REQUIRED_FILES) | 128 include_bisect_file_list = ( |
| 126 strip_files = ','.join(manual_bisect_files.CHROME_STRIP_LIST) | 129 manual_bisect_files.CHROME_REQUIRED_FILES.get(platform)) |
| 127 args.extend(['--include-files', inclusions]) | 130 include_bisect_strip_list = ( |
| 128 args.extend(['--ignore-regex']) | 131 manual_bisect_files.CHROME_STRIP_LIST.get(platform)) |
| 129 args.extend(['--strip-files', strip_files]) | 132 include_bisect_whitelist = ( |
| 133 manual_bisect_files.CHROME_WHITELIST_FILES.get(platform)) |
| 134 if include_bisect_file_list: |
| 135 inclusions = ','.join(include_bisect_file_list) |
| 136 args.extend(['--include-files', inclusions]) |
| 137 if include_bisect_strip_list: |
| 138 strip_files = ','.join(include_bisect_strip_list) |
| 139 args.extend(['--strip-files', strip_files]) |
| 140 if include_bisect_whitelist: |
| 141 args.extend(['--whitelist', include_bisect_whitelist]) |
| 142 args.extend(['--exclude-extra']) |
| 143 |
| 130 # If update_properties is passed in and store_by_hash is False, | 144 # If update_properties is passed in and store_by_hash is False, |
| 131 # we store it with commit position number instead of a hash | 145 # we store it with commit position number instead of a hash |
| 132 if update_properties and not store_by_hash: | 146 if update_properties and not store_by_hash: |
| 133 commit_position = self._get_commit_position( | 147 commit_position = self._get_commit_position( |
| 134 update_properties, None) | 148 update_properties, None) |
| 135 cp_branch, cp_number = self.m.commit_position.parse(commit_position) | 149 cp_branch, cp_number = self.m.commit_position.parse(commit_position) |
| 136 args.extend(['--build_revision', cp_number]) | 150 args.extend(['--build_revision', cp_number]) |
| 137 | 151 |
| 138 properties_json = self.m.json.dumps(self.m.properties.legacy()) | 152 properties_json = self.m.json.dumps(self.m.properties.legacy()) |
| 139 args.extend(['--factory-properties', properties_json, | 153 args.extend(['--factory-properties', properties_json, |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 def legacy_download_url(self, gs_bucket_name, extra_url_components=None): | 439 def legacy_download_url(self, gs_bucket_name, extra_url_components=None): |
| 426 """Returns a url suitable for downloading a Chromium build from | 440 """Returns a url suitable for downloading a Chromium build from |
| 427 Google Storage. | 441 Google Storage. |
| 428 | 442 |
| 429 extra_url_components, if specified, should be a string without a | 443 extra_url_components, if specified, should be a string without a |
| 430 trailing '/' which is inserted in the middle of the URL. | 444 trailing '/' which is inserted in the middle of the URL. |
| 431 | 445 |
| 432 The builder_name, or parent_buildername, is always automatically | 446 The builder_name, or parent_buildername, is always automatically |
| 433 inserted into the URL.""" | 447 inserted into the URL.""" |
| 434 return self._legacy_url(True, gs_bucket_name, extra_url_components) | 448 return self._legacy_url(True, gs_bucket_name, extra_url_components) |
| OLD | NEW |