| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 src_file = join(ANALYZER_HOME, 'util', 'analyzer', jarToCopy) | 295 src_file = join(ANALYZER_HOME, 'util', 'analyzer', jarToCopy) |
| 296 copyfile(src_file, dest_file) | 296 copyfile(src_file, dest_file) |
| 297 | 297 |
| 298 # Create and populate util/pub. | 298 # Create and populate util/pub. |
| 299 copytree(join(HOME, 'utils', 'pub'), join(UTIL, 'pub'), | 299 copytree(join(HOME, 'utils', 'pub'), join(UTIL, 'pub'), |
| 300 ignore=ignore_patterns('.svn', 'sdk')) | 300 ignore=ignore_patterns('.svn', 'sdk')) |
| 301 | 301 |
| 302 # Copy in 7zip for Windows. | 302 # Copy in 7zip for Windows. |
| 303 if utils.GuessOS() == 'win32': | 303 if utils.GuessOS() == 'win32': |
| 304 copytree(join(HOME, 'third_party', '7zip'), | 304 copytree(join(HOME, 'third_party', '7zip'), |
| 305 join(join(UTIL, 'pub'), '7zip')) | 305 join(join(UTIL, 'pub'), '7zip'), |
| 306 ignore=ignore_patterns('.svn')) |
| 306 | 307 |
| 307 ReplaceInFiles([ | 308 ReplaceInFiles([ |
| 308 join(UTIL, 'pub', 'io.dart'), | 309 join(UTIL, 'pub', 'io.dart'), |
| 309 ], [ | 310 ], [ |
| 310 ("var pathTo7zip = '../../third_party/7zip/7za.exe';", | 311 ("var pathTo7zip = '../../third_party/7zip/7za.exe';", |
| 311 "var pathTo7zip = '7zip/7za.exe';"), | 312 "var pathTo7zip = '7zip/7za.exe';"), |
| 312 ]) | 313 ]) |
| 313 | 314 |
| 314 revision = utils.GetSVNRevision() | 315 revision = utils.GetSVNRevision() |
| 315 | 316 |
| 316 # Copy dart2js. | 317 # Copy dart2js. |
| 317 CopyDart2Js(build_dir, SDK_tmp, revision) | 318 CopyDart2Js(build_dir, SDK_tmp, revision) |
| 318 | 319 |
| 319 # Write the 'revision' file | 320 # Write the 'revision' file |
| 320 if revision is not None: | 321 if revision is not None: |
| 321 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 322 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 322 f.write(revision + '\n') | 323 f.write(revision + '\n') |
| 323 f.close() | 324 f.close() |
| 324 | 325 |
| 325 move(SDK_tmp, SDK) | 326 move(SDK_tmp, SDK) |
| 326 utils.Touch(os.path.join(SDK, 'create.stamp')) | 327 utils.Touch(os.path.join(SDK, 'create.stamp')) |
| 327 | 328 |
| 328 if __name__ == '__main__': | 329 if __name__ == '__main__': |
| 329 sys.exit(Main(sys.argv)) | 330 sys.exit(Main(sys.argv)) |
| OLD | NEW |