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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 Copy(src, dest) | 106 Copy(src, dest) |
107 | 107 |
108 | 108 |
109 def CopyDartScripts(home, sdk_root): | 109 def CopyDartScripts(home, sdk_root): |
110 for executable in ['dart2js', 'dartanalyzer', 'dartdoc', 'pub']: | 110 for executable in ['dart2js', 'dartanalyzer', 'dartdoc', 'pub']: |
111 CopyShellScript(os.path.join(home, 'sdk', 'bin', executable), | 111 CopyShellScript(os.path.join(home, 'sdk', 'bin', executable), |
112 os.path.join(sdk_root, 'bin')) | 112 os.path.join(sdk_root, 'bin')) |
113 | 113 |
114 | 114 |
115 def CopySnapshots(snapshots, sdk_root): | 115 def CopySnapshots(snapshots, sdk_root): |
116 for snapshot in ['utils_wrapper', 'pub']: | 116 for snapshot in ['dart2js', 'utils_wrapper', 'pub']: |
117 snapshot += '.dart.snapshot' | 117 snapshot += '.dart.snapshot' |
118 copyfile(join(snapshots, snapshot), | 118 copyfile(join(snapshots, snapshot), |
119 join(sdk_root, 'bin', 'snapshots', snapshot)) | 119 join(sdk_root, 'bin', 'snapshots', snapshot)) |
120 | 120 |
121 | 121 |
122 def Main(argv): | 122 def Main(argv): |
123 # Pull in all of the gypi files which will be munged into the sdk. | 123 # Pull in all of the gypi files which will be munged into the sdk. |
124 HOME = dirname(dirname(realpath(__file__))) | 124 HOME = dirname(dirname(realpath(__file__))) |
125 | 125 |
126 (options, args) = GetOptions() | 126 (options, args) = GetOptions() |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 255 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
256 f.write(revision + '\n') | 256 f.write(revision + '\n') |
257 f.close() | 257 f.close() |
258 | 258 |
259 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 259 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
260 | 260 |
261 move(SDK_tmp, SDK) | 261 move(SDK_tmp, SDK) |
262 | 262 |
263 if __name__ == '__main__': | 263 if __name__ == '__main__': |
264 sys.exit(Main(sys.argv)) | 264 sys.exit(Main(sys.argv)) |
OLD | NEW |