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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 join(LIB, 'dartdoc', 'client-live-nav.dart'), | 300 join(LIB, 'dartdoc', 'client-live-nav.dart'), |
297 join(LIB, 'dartdoc', 'client-static.dart') | 301 join(LIB, 'dartdoc', 'client-static.dart') |
298 ], [ | 302 ], [ |
299 ("#import\('../../frog", "#import('../frog") | 303 ("#import\('../../frog", "#import('../frog") |
300 ]) | 304 ]) |
301 | 305 |
302 # Create and populate lib/isolate | 306 # Create and populate lib/isolate |
303 copytree(join(HOME, 'lib', 'isolate'), join(LIB, 'isolate'), | 307 copytree(join(HOME, 'lib', 'isolate'), join(LIB, 'isolate'), |
304 ignore=ignore_patterns('.svn')) | 308 ignore=ignore_patterns('.svn')) |
305 | 309 |
| 310 isolate_runtime_src = join('runtime', 'lib', 'isolate.dart') |
| 311 isolate_runtime_dest = join(LIB, 'isolate', 'runtime', 'isolate.dart') |
| 312 copyfile(isolate_runtime_src, isolate_runtime_dest) |
| 313 |
306 # | 314 # |
307 # Create and populate lib/core. | 315 # Create and populate lib/core. |
308 # | 316 # |
309 | 317 |
310 # First, copy corelib/* to lib/{frog, runtime} | 318 # First, copy corelib/* to lib/{frog, runtime} |
311 for filename in corelib_sources: | 319 for filename in corelib_sources: |
312 for target_dir in ['frog', 'runtime']: | 320 for target_dir in ['frog', 'runtime']: |
313 copyfile(join('corelib', 'src', filename), | 321 copyfile(join('corelib', 'src', filename), |
314 join(corelib_dest_dir, target_dir, filename)) | 322 join(corelib_dest_dir, target_dir, filename)) |
315 | 323 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 # Construct lib/coreimpl/coreimpl_runtime.dart from whole cloth. | 391 # Construct lib/coreimpl/coreimpl_runtime.dart from whole cloth. |
384 dest_file = open(join(coreimpl_dest_dir, 'coreimpl_runtime.dart'), 'w') | 392 dest_file = open(join(coreimpl_dest_dir, 'coreimpl_runtime.dart'), 'w') |
385 dest_file.write('#library("dart:coreimpl");\n') | 393 dest_file.write('#library("dart:coreimpl");\n') |
386 for filename in coreimpl_sources: | 394 for filename in coreimpl_sources: |
387 dest_file.write('#source("runtime/' + filename + '");\n') | 395 dest_file.write('#source("runtime/' + filename + '");\n') |
388 for filename in coreimpl_runtime_sources: | 396 for filename in coreimpl_runtime_sources: |
389 if filename.endswith('.dart'): | 397 if filename.endswith('.dart'): |
390 dest_file.write('#source("runtime/' + filename + '");\n') | 398 dest_file.write('#source("runtime/' + filename + '");\n') |
391 dest_file.close() | 399 dest_file.close() |
392 | 400 |
| 401 # Create and copy Analysis library. |
| 402 |
| 403 ANALYSIS = join(SDK_tmp, 'analysis') |
| 404 os.makedirs(ANALYSIS) |
| 405 ANALYSIS_HOME = join(build_dir, 'analysis') |
| 406 darta_src_binary = join(ANALYSIS_HOME,'darta') |
| 407 darta_dest_binary = join(ANALYSIS, 'darta') |
| 408 copyfile(darta_src_binary, darta_dest_binary) |
| 409 copymode(darta_src_binary, darta_dest_binary) |
| 410 darta_src_jar = join(ANALYSIS_HOME, 'darta.jar') |
| 411 darta_dest_jar = join(ANALYSIS, 'darta.jar') |
| 412 copyfile(darta_src_jar, darta_dest_jar) |
| 413 |
| 414 jarsToCopy = [ join("args4j", "2.0.12", "args4j-2.0.12.jar"), |
| 415 join("guava", "r09", "guava-r09.jar"), |
| 416 join("json", "r2_20080312", "json.jar") ] |
| 417 for jarToCopy in jarsToCopy: |
| 418 dest_dir = join (ANALYSIS, os.path.dirname(jarToCopy)) |
| 419 os.makedirs(dest_dir) |
| 420 dest_file = join (ANALYSIS, jarToCopy) |
| 421 src_file = join(ANALYSIS_HOME, jarToCopy) |
| 422 copyfile(src_file, dest_file) |
| 423 |
| 424 |
393 # Create and copy tools. | 425 # Create and copy tools. |
394 | 426 |
395 UTIL = join(SDK_tmp, 'util') | 427 UTIL = join(SDK_tmp, 'util') |
396 os.makedirs(UTIL) | 428 os.makedirs(UTIL) |
397 | 429 |
| 430 |
398 move(SDK_tmp, SDK) | 431 move(SDK_tmp, SDK) |
399 | 432 |
400 if __name__ == '__main__': | 433 if __name__ == '__main__': |
401 sys.exit(Main(sys.argv)) | 434 sys.exit(Main(sys.argv)) |
OLD | NEW |