| 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 17 matching lines...) Expand all Loading... |
| 28 # ......coreimpl/ | 28 # ......coreimpl/ |
| 29 # ........coreimpl_{frog, runtime}.dart | 29 # ........coreimpl_{frog, runtime}.dart |
| 30 # ........{frog, runtime}/ | 30 # ........{frog, runtime}/ |
| 31 # ......dartdoc/ | 31 # ......dartdoc/ |
| 32 # ......isolate/ | 32 # ......isolate/ |
| 33 # ........isolate_{frog, runtime}.dart | 33 # ........isolate_{frog, runtime}.dart |
| 34 # ........{frog, runtime}/ | 34 # ........{frog, runtime}/ |
| 35 # ......dom/ | 35 # ......dom/ |
| 36 # ........dom.dart | 36 # ........dom.dart |
| 37 # ......frog/ | 37 # ......frog/ |
| 38 # ......html/ | 38 # ......html/ |
| 39 # ........html_frog.dart | 39 # ........html_frog.dart |
| 40 # ........html_dartium.dart | 40 # ........html_dartium.dart |
| 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) |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 # | 157 # |
| 158 # Create and populate lib/builtin. | 158 # Create and populate lib/builtin. |
| 159 # | 159 # |
| 160 builtin_dest_dir = join(LIB, 'builtin') | 160 builtin_dest_dir = join(LIB, 'builtin') |
| 161 os.makedirs(builtin_dest_dir) | 161 os.makedirs(builtin_dest_dir) |
| 162 assert len(builtin_runtime_sources) == 1 | 162 assert len(builtin_runtime_sources) == 1 |
| 163 assert builtin_runtime_sources[0] == 'builtin.dart' | 163 assert builtin_runtime_sources[0] == 'builtin.dart' |
| 164 copyfile(join(HOME, 'runtime', 'bin', 'builtin.dart'), | 164 copyfile(join(HOME, 'runtime', 'bin', 'builtin.dart'), |
| 165 join(builtin_dest_dir, 'builtin_runtime.dart')) | 165 join(builtin_dest_dir, 'builtin_runtime.dart')) |
| 166 # | 166 # |
| 167 # rename the print function in dart:builtin | 167 # rename the print function in dart:builtin |
| 168 # so that it does not conflict with the print function in dart:core | 168 # so that it does not conflict with the print function in dart:core |
| 169 # | 169 # |
| 170 ReplaceInFiles([ | 170 ReplaceInFiles([ |
| 171 join(builtin_dest_dir, 'builtin_runtime.dart') | 171 join(builtin_dest_dir, 'builtin_runtime.dart') |
| 172 ], [ | 172 ], [ |
| 173 ('void print\(', 'void builtinPrint(') | 173 ('void print\(', 'void builtinPrint(') |
| 174 ]) | 174 ]) |
| 175 | 175 |
| 176 # | 176 # |
| 177 # Create and populate lib/io. | 177 # Create and populate lib/io. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 for filename in os.listdir(src_dir): | 275 for filename in os.listdir(src_dir): |
| 276 if filename.endswith('.dart'): | 276 if filename.endswith('.dart'): |
| 277 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 277 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
| 278 | 278 |
| 279 # Create and populate lib/dartdoc | 279 # Create and populate lib/dartdoc |
| 280 dartdoc_src_dir = join(HOME, 'lib', 'dartdoc') | 280 dartdoc_src_dir = join(HOME, 'lib', 'dartdoc') |
| 281 dartdoc_dest_dir = join(LIB, 'dartdoc') | 281 dartdoc_dest_dir = join(LIB, 'dartdoc') |
| 282 copytree(dartdoc_src_dir, dartdoc_dest_dir, | 282 copytree(dartdoc_src_dir, dartdoc_dest_dir, |
| 283 ignore=ignore_patterns('.svn', 'docs')) | 283 ignore=ignore_patterns('.svn', 'docs')) |
| 284 ReplaceInFiles([ | 284 ReplaceInFiles([ |
| 285 join(LIB, 'dartdoc', 'dartdoc') | |
| 286 ], [ | |
| 287 ("../../frog/minfrog", "../../bin/frogc"), | |
| 288 ("--libdir=../../frog/lib", "--libdir=../") | |
| 289 ]) | |
| 290 ReplaceInFiles([ | |
| 291 join(LIB, 'dartdoc', 'dartdoc.dart') | 285 join(LIB, 'dartdoc', 'dartdoc.dart') |
| 292 ], [ | 286 ], [ |
| 293 ("#import\('../../frog", "#import('../frog"), | 287 ("#import\('../../frog", "#import('../frog"), |
| 294 ("'../../frog'", "'../frog'"), | 288 ("joinPaths\(scriptDir, '../../frog/'\)", |
| 295 ("'--libdir=../../frog/lib'", "'--libdir=../'") | 289 "joinPaths(scriptDir, '../frog/')"), |
| 290 ("joinPaths\(frogPath, 'lib'\)", "joinPaths(frogPath, '..')"), |
| 291 ("joinPaths\(frogPath, 'minfrog'\)", |
| 292 "joinPaths(scriptDir, '../../bin/frogc')") |
| 296 ]) | 293 ]) |
| 297 ReplaceInFiles([ | 294 ReplaceInFiles([ |
| 298 join(LIB, 'dartdoc', 'classify.dart'), | 295 join(LIB, 'dartdoc', 'classify.dart'), |
| 299 join(LIB, 'dartdoc', 'client-live-nav.dart'), | 296 join(LIB, 'dartdoc', 'client-live-nav.dart'), |
| 300 join(LIB, 'dartdoc', 'client-static.dart') | 297 join(LIB, 'dartdoc', 'client-static.dart') |
| 301 ], [ | 298 ], [ |
| 302 ("#import\('../../frog", "#import('../frog") | 299 ("#import\('../../frog", "#import('../frog") |
| 303 ]) | 300 ]) |
| 304 | 301 |
| 305 # Create and populate lib/isolate | 302 # Create and populate lib/isolate |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 392 |
| 396 # Create and copy tools. | 393 # Create and copy tools. |
| 397 | 394 |
| 398 UTIL = join(SDK_tmp, 'util') | 395 UTIL = join(SDK_tmp, 'util') |
| 399 os.makedirs(UTIL) | 396 os.makedirs(UTIL) |
| 400 | 397 |
| 401 move(SDK_tmp, SDK) | 398 move(SDK_tmp, SDK) |
| 402 | 399 |
| 403 if __name__ == '__main__': | 400 if __name__ == '__main__': |
| 404 sys.exit(Main(sys.argv)) | 401 sys.exit(Main(sys.argv)) |
| OLD | NEW |