OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Build script to generate a new sdk_tools bundle. | 6 """Build script to generate a new sdk_tools bundle. |
7 | 7 |
8 This script packages the files necessary to generate the SDK updater -- the | 8 This script packages the files necessary to generate the SDK updater -- the |
9 tool users run to download new bundles, update existing bundles, etc. | 9 tool users run to download new bundles, update existing bundles, etc. |
10 """ | 10 """ |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 open(SDK_UPDATE_MAIN, 'w').write(contents) | 135 open(SDK_UPDATE_MAIN, 'w').write(contents) |
136 | 136 |
137 | 137 |
138 def BuildUpdater(out_dir, revision_number=None): | 138 def BuildUpdater(out_dir, revision_number=None): |
139 """Build naclsdk.zip and sdk_tools.tgz in |out_dir|. | 139 """Build naclsdk.zip and sdk_tools.tgz in |out_dir|. |
140 | 140 |
141 Args: | 141 Args: |
142 out_dir: The output directory. | 142 out_dir: The output directory. |
143 revision_number: The revision number of this updater, as an integer. Or | 143 revision_number: The revision number of this updater, as an integer. Or |
144 None, to use the current Chrome revision.""" | 144 None, to use the current Chrome revision.""" |
145 buildbot_common.BuildStep('Create Updater') | |
Sam Clegg
2014/09/11 19:13:11
We don't want a build step for this?
binji
2014/09/11 19:17:14
Not in this script, it already has a build step wh
| |
146 | |
147 out_dir = os.path.abspath(out_dir) | 145 out_dir = os.path.abspath(out_dir) |
148 | 146 |
149 # Build SDK directory | 147 # Build SDK directory |
150 buildbot_common.RemoveDir(os.path.join(out_dir, 'nacl_sdk')) | 148 buildbot_common.RemoveDir(os.path.join(out_dir, 'nacl_sdk')) |
151 | 149 |
152 updater_files = MakeUpdaterFilesAbsolute(out_dir) | 150 updater_files = MakeUpdaterFilesAbsolute(out_dir) |
153 updater_files = GlobFiles(updater_files) | 151 updater_files = GlobFiles(updater_files) |
154 | 152 |
155 CopyFiles(updater_files) | 153 CopyFiles(updater_files) |
156 UpdateRevisionNumber(out_dir, revision_number) | 154 UpdateRevisionNumber(out_dir, revision_number) |
(...skipping 17 matching lines...) Expand all Loading... | |
174 os.path.join(out_dir, sdktoolsdir), '-czf', tarname] + files_to_tar) | 172 os.path.join(out_dir, sdktoolsdir), '-czf', tarname] + files_to_tar) |
175 sys.stdout.write('\n') | 173 sys.stdout.write('\n') |
176 | 174 |
177 | 175 |
178 def main(args): | 176 def main(args): |
179 parser = optparse.OptionParser() | 177 parser = optparse.OptionParser() |
180 parser.add_option('-o', '--out', help='output directory', | 178 parser.add_option('-o', '--out', help='output directory', |
181 dest='out_dir', default=os.path.join(SRC_DIR, 'out')) | 179 dest='out_dir', default=os.path.join(SRC_DIR, 'out')) |
182 parser.add_option('-r', '--revision', help='revision number of this updater', | 180 parser.add_option('-r', '--revision', help='revision number of this updater', |
183 dest='revision', default=None) | 181 dest='revision', default=None) |
182 parser.add_option('-v', '--verbose', help='verbose output') | |
184 options, args = parser.parse_args(args[1:]) | 183 options, args = parser.parse_args(args[1:]) |
185 | 184 |
185 buildbot_common.verbose = options.verbose | |
186 | |
186 if options.revision: | 187 if options.revision: |
187 options.revision = int(options.revision) | 188 options.revision = int(options.revision) |
188 BuildUpdater(options.out_dir, options.revision) | 189 BuildUpdater(options.out_dir, options.revision) |
189 | 190 |
190 | 191 |
191 if __name__ == '__main__': | 192 if __name__ == '__main__': |
192 sys.exit(main(sys.argv)) | 193 sys.exit(main(sys.argv)) |
OLD | NEW |