| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 # Create and copy dartanalyzer into 'util' | 223 # Create and copy dartanalyzer into 'util' |
| 224 DARTANALYZER_SRC = join(HOME, build_dir, 'dartanalyzer') | 224 DARTANALYZER_SRC = join(HOME, build_dir, 'dartanalyzer') |
| 225 DARTANALYZER_DEST = join(UTIL, 'dartanalyzer') | 225 DARTANALYZER_DEST = join(UTIL, 'dartanalyzer') |
| 226 os.makedirs(DARTANALYZER_DEST) | 226 os.makedirs(DARTANALYZER_DEST) |
| 227 | 227 |
| 228 jarFiles = glob.glob(join(DARTANALYZER_SRC, '*.jar')) | 228 jarFiles = glob.glob(join(DARTANALYZER_SRC, '*.jar')) |
| 229 | 229 |
| 230 for jarFile in jarFiles: | 230 for jarFile in jarFiles: |
| 231 copyfile(jarFile, join(DARTANALYZER_DEST, os.path.basename(jarFile))) | 231 copyfile(jarFile, join(DARTANALYZER_DEST, os.path.basename(jarFile))) |
| 232 | 232 |
| 233 RESOURCE = join(SDK_tmp, 'lib', '_internal', 'pub', 'asset') |
| 234 os.makedirs(os.path.dirname(RESOURCE)) |
| 235 copytree(join(HOME, 'sdk', 'lib', '_internal', 'pub', 'asset'), |
| 236 join(RESOURCE), |
| 237 ignore=ignore_patterns('.svn')) |
| 238 |
| 233 # Copy in 7zip for Windows. | 239 # Copy in 7zip for Windows. |
| 234 if HOST_OS == 'win32': | 240 if HOST_OS == 'win32': |
| 235 RESOURCE = join(SDK_tmp, 'lib', '_internal', 'pub', 'resource') | |
| 236 os.makedirs(RESOURCE) | |
| 237 copytree(join(HOME, 'third_party', '7zip'), | 241 copytree(join(HOME, 'third_party', '7zip'), |
| 238 join(RESOURCE, '7zip'), | 242 join(RESOURCE, '7zip'), |
| 239 ignore=ignore_patterns('.svn')) | 243 ignore=ignore_patterns('.svn')) |
| 240 | 244 |
| 241 # Copy dart2js/pub. | 245 # Copy dart2js/pub. |
| 242 CopyDartScripts(HOME, SDK_tmp) | 246 CopyDartScripts(HOME, SDK_tmp) |
| 243 CopySnapshots(SNAPSHOT, SDK_tmp) | 247 CopySnapshots(SNAPSHOT, SDK_tmp) |
| 244 | 248 |
| 245 # Write the 'version' file | 249 # Write the 'version' file |
| 246 version = utils.GetVersion() | 250 version = utils.GetVersion() |
| 247 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') | 251 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') |
| 248 versionFile.write(version + '\n') | 252 versionFile.write(version + '\n') |
| 249 versionFile.close() | 253 versionFile.close() |
| 250 | 254 |
| 251 # Write the 'revision' file | 255 # Write the 'revision' file |
| 252 revision = utils.GetSVNRevision() | 256 revision = utils.GetSVNRevision() |
| 253 | 257 |
| 254 if revision is not None: | 258 if revision is not None: |
| 255 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 259 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 256 f.write(revision + '\n') | 260 f.write(revision + '\n') |
| 257 f.close() | 261 f.close() |
| 258 | 262 |
| 259 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 263 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
| 260 | 264 |
| 261 move(SDK_tmp, SDK) | 265 move(SDK_tmp, SDK) |
| 262 | 266 |
| 263 if __name__ == '__main__': | 267 if __name__ == '__main__': |
| 264 sys.exit(Main(sys.argv)) | 268 sys.exit(Main(sys.argv)) |
| OLD | NEW |