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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 dest.close() | 91 dest.close() |
92 | 92 |
93 | 93 |
94 def Copy(src, dest): | 94 def Copy(src, dest): |
95 copyfile(src, dest) | 95 copyfile(src, dest) |
96 copymode(src, dest) | 96 copymode(src, dest) |
97 | 97 |
98 # TODO(zundel): this excludes the analyzer from the sdk build until builders | 98 # TODO(zundel): this excludes the analyzer from the sdk build until builders |
99 # have all prerequisite software installed. Also update dart.gyp. | 99 # have all prerequisite software installed. Also update dart.gyp. |
100 def ShouldCopyAnalyzer(): | 100 def ShouldCopyAnalyzer(): |
101 os = utils.GuessOS(); | 101 os = utils.GuessOS(); |
102 return os == 'linux' or os == 'macos' | 102 return os == 'linux' or os == 'macos' |
103 | 103 |
104 | 104 |
105 def CopyShellScript(src_file, dest_dir): | 105 def CopyShellScript(src_file, dest_dir): |
106 '''Copies a shell/batch script to the given destination directory. Handles | 106 '''Copies a shell/batch script to the given destination directory. Handles |
107 using the appropriate platform-specific file extension.''' | 107 using the appropriate platform-specific file extension.''' |
108 file_extension = '' | 108 file_extension = '' |
109 if utils.GuessOS() == 'win32': | 109 if utils.GuessOS() == 'win32': |
110 file_extension = '.bat' | 110 file_extension = '.bat' |
111 | 111 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 for filename in os.listdir(src_dir): | 334 for filename in os.listdir(src_dir): |
335 if filename.endswith('.dart'): | 335 if filename.endswith('.dart'): |
336 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 336 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
337 | 337 |
338 # Create and populate lib/dartdoc. | 338 # Create and populate lib/dartdoc. |
339 dartdoc_src_dir = join(HOME, 'lib', 'dartdoc') | 339 dartdoc_src_dir = join(HOME, 'lib', 'dartdoc') |
340 dartdoc_dest_dir = join(LIB, 'dartdoc') | 340 dartdoc_dest_dir = join(LIB, 'dartdoc') |
341 copytree(dartdoc_src_dir, dartdoc_dest_dir, | 341 copytree(dartdoc_src_dir, dartdoc_dest_dir, |
342 ignore=ignore_patterns('.svn', 'docs')) | 342 ignore=ignore_patterns('.svn', 'docs')) |
343 | 343 |
344 # Fixup frog dependencies. | 344 # Fixup dart2js dependencies. |
345 ReplaceInFiles([join(LIB, 'dartdoc', 'dartdoc.dart')], [ | 345 ReplaceInFiles([ |
346 ("'dart2js'", "joinPaths(scriptDir, '../../bin/dart2js')"), | 346 join(LIB, 'dartdoc', 'dartdoc.dart'), |
347 ], [ | |
348 ("scriptDir,'../'", | |
349 "scriptDir,'../dart2js/lib/'"), | |
347 ]) | 350 ]) |
351 ReplaceInFiles([ | |
352 join(LIB, 'dartdoc', 'dartdoc.dart'), | |
353 ], [ | |
354 ("scriptDir,'../../'", | |
Lasse Reichstein Nielsen
2012/07/09 10:39:33
Space after commas!
Johnni Winther
2012/07/09 14:57:18
Done.
| |
355 "scriptDir,'../dart2js/'"), | |
356 ]) | |
357 | |
348 ReplaceInFiles([join(LIB, 'dartdoc', 'frog', 'frog_options.dart')], [ | 358 ReplaceInFiles([join(LIB, 'dartdoc', 'frog', 'frog_options.dart')], [ |
kasperl
2012/07/06 12:40:41
Can you get rid of these 3 replacements (frog rela
Lasse Reichstein Nielsen
2012/07/09 10:39:33
Yes, please!
Johnni Winther
2012/07/09 14:57:18
They will be removed together with the dartdoc/fro
| |
349 ("final config = \'dev\';", "final config = \'sdk\';") | 359 ("final config = \'dev\';", "final config = \'sdk\';") |
350 ]) | 360 ]) |
351 ReplaceInFiles([join(LIB, 'dartdoc', 'frog', 'lib', 'corelib.dart')], [ | 361 ReplaceInFiles([join(LIB, 'dartdoc', 'frog', 'lib', 'corelib.dart')], [ |
352 ("../../../../corelib/src/", "../../../core/runtime/") | 362 ("../../../../corelib/src/", "../../../core/runtime/") |
353 ]); | 363 ]); |
354 ReplaceInFiles([join(LIB, 'dartdoc', 'frog', 'lib', 'corelib_impl.dart')], [ | 364 ReplaceInFiles([join(LIB, 'dartdoc', 'frog', 'lib', 'corelib_impl.dart')], [ |
355 ("../../../../corelib/src/implementation", "../../../coreimpl/runtime/") | 365 ("../../../../corelib/src/implementation", "../../../coreimpl/runtime/") |
356 ]); | 366 ]); |
357 | 367 |
358 # Create and populate lib/isolate | 368 # Create and populate lib/isolate |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
462 if revision is not None: | 472 if revision is not None: |
463 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 473 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
464 f.write(revision + '\n') | 474 f.write(revision + '\n') |
465 f.close() | 475 f.close() |
466 | 476 |
467 move(SDK_tmp, SDK) | 477 move(SDK_tmp, SDK) |
468 utils.Touch(os.path.join(SDK, 'create.stamp')) | 478 utils.Touch(os.path.join(SDK, 'create.stamp')) |
469 | 479 |
470 if __name__ == '__main__': | 480 if __name__ == '__main__': |
471 sys.exit(Main(sys.argv)) | 481 sys.exit(Main(sys.argv)) |
OLD | NEW |