OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 # | 6 # |
7 # A script which will be invoked from gyp to create an SDK. | 7 # A script which will be invoked from gyp to create an SDK. |
8 # | 8 # |
9 # Usage: create_sdk.py sdk_directory | 9 # Usage: create_sdk.py sdk_directory |
10 # | 10 # |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 DARTDOC = join(RESOURCE_DIR, 'dartdoc') | 138 DARTDOC = join(RESOURCE_DIR, 'dartdoc') |
139 | 139 |
140 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'templates'), | 140 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'templates'), |
141 join(DARTDOC, 'templates')) | 141 join(DARTDOC, 'templates')) |
142 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'resources'), | 142 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'resources'), |
143 join(DARTDOC, 'resources')) | 143 join(DARTDOC, 'resources')) |
144 # write the .packages file | 144 # write the .packages file |
145 PACKAGES_FILE = join(DARTDOC, '.packages') | 145 PACKAGES_FILE = join(DARTDOC, '.packages') |
146 packages_file = open(PACKAGES_FILE, 'w') | 146 packages_file = open(PACKAGES_FILE, 'w') |
147 packages_file.write('dartdoc:.') | 147 packages_file.write('dartdoc:.') |
148 packages_file.close() | 148 packages_file.close() |
149 | 149 |
150 | 150 |
151 def Main(): | 151 def Main(): |
152 # Pull in all of the gypi files which will be munged into the sdk. | 152 # Pull in all of the gypi files which will be munged into the sdk. |
153 HOME = dirname(dirname(realpath(__file__))) | 153 HOME = dirname(dirname(realpath(__file__))) |
154 | 154 |
155 (options, args) = GetOptions() | 155 (options, args) = GetOptions() |
156 | 156 |
157 SDK = options.sdk_output_dir | 157 SDK = options.sdk_output_dir |
158 SDK_tmp = '%s.tmp' % SDK | 158 SDK_tmp = '%s.tmp' % SDK |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 for library in [join('_blink', 'dartium'), | 226 for library in [join('_blink', 'dartium'), |
227 join('_chrome', 'dart2js'), join('_chrome', 'dartium'), | 227 join('_chrome', 'dart2js'), join('_chrome', 'dartium'), |
228 join('_internal', 'js_runtime'), | 228 join('_internal', 'js_runtime'), |
229 join('_internal', 'sdk_library_metadata'), | 229 join('_internal', 'sdk_library_metadata'), |
230 'async', 'collection', 'convert', 'core', 'developer', | 230 'async', 'collection', 'convert', 'core', 'developer', |
231 'internal', 'io', 'isolate', | 231 'internal', 'io', 'isolate', |
232 join('html', 'dart2js'), join('html', 'dartium'), | 232 join('html', 'dart2js'), join('html', 'dartium'), |
233 join('html', 'html_common'), | 233 join('html', 'html_common'), |
234 join('indexed_db', 'dart2js'), join('indexed_db', 'dartium'), | 234 join('indexed_db', 'dart2js'), join('indexed_db', 'dartium'), |
235 'js', 'math', 'mirrors', 'profiler', 'typed_data', | 235 'js', 'math', 'mirrors', 'typed_data', |
236 join('svg', 'dart2js'), join('svg', 'dartium'), | 236 join('svg', 'dart2js'), join('svg', 'dartium'), |
237 join('web_audio', 'dart2js'), join('web_audio', 'dartium'), | 237 join('web_audio', 'dart2js'), join('web_audio', 'dartium'), |
238 join('web_gl', 'dart2js'), join('web_gl', 'dartium'), | 238 join('web_gl', 'dart2js'), join('web_gl', 'dartium'), |
239 join('web_sql', 'dart2js'), join('web_sql', 'dartium')]: | 239 join('web_sql', 'dart2js'), join('web_sql', 'dartium')]: |
240 copytree(join(HOME, 'sdk', 'lib', library), join(LIB, library), | 240 copytree(join(HOME, 'sdk', 'lib', library), join(LIB, library), |
241 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh', | 241 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh', |
242 '.gitignore')) | 242 '.gitignore')) |
243 | 243 |
244 # Copy libraries.dart to lib/_internal/libraries.dart for backwards | 244 # Copy libraries.dart to lib/_internal/libraries.dart for backwards |
245 # compatibility. | 245 # compatibility. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 f.write('%s\n' % revision) | 288 f.write('%s\n' % revision) |
289 f.close() | 289 f.close() |
290 | 290 |
291 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 291 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
292 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md')
) | 292 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md')
) |
293 | 293 |
294 move(SDK_tmp, SDK) | 294 move(SDK_tmp, SDK) |
295 | 295 |
296 if __name__ == '__main__': | 296 if __name__ == '__main__': |
297 sys.exit(Main()) | 297 sys.exit(Main()) |
OLD | NEW |