| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, 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 30 matching lines...) Expand all Loading... |
| 41 # ......json/ | 41 # ......json/ |
| 42 # ........json_frog.dart | 42 # ........json_frog.dart |
| 43 #.........json.dart | 43 #.........json.dart |
| 44 # ........{frog}/ | 44 # ........{frog}/ |
| 45 # ......uri/ | 45 # ......uri/ |
| 46 # ........uri.dart | 46 # ........uri.dart |
| 47 # ......utf/ | 47 # ......utf/ |
| 48 # ......(more will come here) | 48 # ......(more will come here) |
| 49 # ....util/ | 49 # ....util/ |
| 50 # ......(more will come here) | 50 # ......(more will come here) |
| 51 # ....analysis/ |
| 52 # ......darta |
| 53 # ......darta.jar |
| 54 # ......<third party libs> |
| 51 | 55 |
| 52 | 56 |
| 53 | 57 |
| 54 import os | 58 import os |
| 55 import re | 59 import re |
| 56 import sys | 60 import sys |
| 57 import tempfile | 61 import tempfile |
| 58 import utils | 62 import utils |
| 59 | 63 |
| 60 from os.path import dirname, join, realpath, exists, isdir | 64 from os.path import dirname, join, realpath, exists, isdir |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 join(LIB, 'dartdoc', 'client-live-nav.dart'), | 295 join(LIB, 'dartdoc', 'client-live-nav.dart'), |
| 292 join(LIB, 'dartdoc', 'client-static.dart') | 296 join(LIB, 'dartdoc', 'client-static.dart') |
| 293 ], [ | 297 ], [ |
| 294 ("#import\('../../frog", "#import('../frog") | 298 ("#import\('../../frog", "#import('../frog") |
| 295 ]) | 299 ]) |
| 296 | 300 |
| 297 # Create and populate lib/isolate | 301 # Create and populate lib/isolate |
| 298 copytree(join(HOME, 'lib', 'isolate'), join(LIB, 'isolate'), | 302 copytree(join(HOME, 'lib', 'isolate'), join(LIB, 'isolate'), |
| 299 ignore=ignore_patterns('.svn')) | 303 ignore=ignore_patterns('.svn')) |
| 300 | 304 |
| 305 isolate_runtime_src = join('runtime', 'lib', 'isolate.dart') |
| 306 isolate_runtime_dest = join(LIB, 'isolate', 'runtime', 'isolate.dart') |
| 307 copyfile(isolate_runtime_src, isolate_runtime_dest) |
| 308 |
| 301 # | 309 # |
| 302 # Create and populate lib/core. | 310 # Create and populate lib/core. |
| 303 # | 311 # |
| 304 | 312 |
| 305 # First, copy corelib/* to lib/{frog, runtime} | 313 # First, copy corelib/* to lib/{frog, runtime} |
| 306 for filename in corelib_sources: | 314 for filename in corelib_sources: |
| 307 for target_dir in ['frog', 'runtime']: | 315 for target_dir in ['frog', 'runtime']: |
| 308 copyfile(join('corelib', 'src', filename), | 316 copyfile(join('corelib', 'src', filename), |
| 309 join(corelib_dest_dir, target_dir, filename)) | 317 join(corelib_dest_dir, target_dir, filename)) |
| 310 | 318 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 # Construct lib/coreimpl/coreimpl_runtime.dart from whole cloth. | 384 # Construct lib/coreimpl/coreimpl_runtime.dart from whole cloth. |
| 377 dest_file = open(join(coreimpl_dest_dir, 'coreimpl_runtime.dart'), 'w') | 385 dest_file = open(join(coreimpl_dest_dir, 'coreimpl_runtime.dart'), 'w') |
| 378 dest_file.write('#library("dart:coreimpl");\n') | 386 dest_file.write('#library("dart:coreimpl");\n') |
| 379 for filename in coreimpl_sources: | 387 for filename in coreimpl_sources: |
| 380 dest_file.write('#source("runtime/' + filename + '");\n') | 388 dest_file.write('#source("runtime/' + filename + '");\n') |
| 381 for filename in coreimpl_runtime_sources: | 389 for filename in coreimpl_runtime_sources: |
| 382 if filename.endswith('.dart'): | 390 if filename.endswith('.dart'): |
| 383 dest_file.write('#source("runtime/' + filename + '");\n') | 391 dest_file.write('#source("runtime/' + filename + '");\n') |
| 384 dest_file.close() | 392 dest_file.close() |
| 385 | 393 |
| 394 # Create and copy Analysis library. |
| 395 |
| 396 ANALYSIS = join(SDK_tmp, 'analysis') |
| 397 os.makedirs(ANALYSIS) |
| 398 ANALYSIS_HOME = join(build_dir, 'analysis') |
| 399 darta_src_binary = join(ANALYSIS_HOME,'darta') |
| 400 darta_dest_binary = join(ANALYSIS, 'darta') |
| 401 copyfile(darta_src_binary, darta_dest_binary) |
| 402 copymode(darta_src_binary, darta_dest_binary) |
| 403 darta_src_jar = join(ANALYSIS_HOME, 'darta.jar') |
| 404 darta_dest_jar = join(ANALYSIS, 'darta.jar') |
| 405 copyfile(darta_src_jar, darta_dest_jar) |
| 406 |
| 407 jarsToCopy = [ join("args4j", "2.0.12", "args4j-2.0.12.jar"), |
| 408 join("guava", "r09", "guava-r09.jar"), |
| 409 join("json", "r2_20080312", "json.jar") ] |
| 410 for jarToCopy in jarsToCopy: |
| 411 dest_dir = join (ANALYSIS, os.path.dirname(jarToCopy)) |
| 412 os.makedirs(dest_dir) |
| 413 dest_file = join (ANALYSIS, jarToCopy) |
| 414 src_file = join(ANALYSIS_HOME, jarToCopy) |
| 415 copyfile(src_file, dest_file) |
| 416 |
| 417 |
| 386 # Create and copy tools. | 418 # Create and copy tools. |
| 387 | 419 |
| 388 UTIL = join(SDK_tmp, 'util') | 420 UTIL = join(SDK_tmp, 'util') |
| 389 os.makedirs(UTIL) | 421 os.makedirs(UTIL) |
| 390 | 422 |
| 423 |
| 391 move(SDK_tmp, SDK) | 424 move(SDK_tmp, SDK) |
| 392 | 425 |
| 393 if __name__ == '__main__': | 426 if __name__ == '__main__': |
| 394 sys.exit(Main(sys.argv)) | 427 sys.exit(Main(sys.argv)) |
| OLD | NEW |