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 20 matching lines...) Expand all Loading... | |
31 #.........resources/ | 31 #.........resources/ |
32 #...........dartdoc/ | 32 #...........dartdoc/ |
33 #..............packages | 33 #..............packages |
34 #.............resources/ | 34 #.............resources/ |
35 #.............templates/ | 35 #.............templates/ |
36 # ....include/ | 36 # ....include/ |
37 # ......dart_api.h | 37 # ......dart_api.h |
38 # ......dart_mirrors_api.h | 38 # ......dart_mirrors_api.h |
39 # ......dart_native_api.h | 39 # ......dart_native_api.h |
40 # ......dart_tools_api.h | 40 # ......dart_tools_api.h |
41 # ....lib/ | 41 # ....lib/ |
Bill Hesse
2016/01/20 18:51:39
Please update this comment to show the new directo
pquitslund
2016/02/03 17:38:10
Done.
| |
42 # ......dart_client.platform | 42 # ......dart_client.platform |
43 # ......dart_server.platform | 43 # ......dart_server.platform |
44 # ......dart_shared.platform | 44 # ......dart_shared.platform |
45 # ......dart2dart.platform | 45 # ......dart2dart.platform |
46 # ......_internal/ | 46 # ......_internal/ |
47 # ......async/ | 47 # ......async/ |
48 # ......collection/ | 48 # ......collection/ |
49 # ......convert/ | 49 # ......convert/ |
50 # ......core/ | 50 # ......core/ |
51 # ......html/ | 51 # ......html/ |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 os.path.join(sdk_root, 'bin')) | 130 os.path.join(sdk_root, 'bin')) |
131 | 131 |
132 | 132 |
133 def CopySnapshots(snapshots, sdk_root): | 133 def CopySnapshots(snapshots, sdk_root): |
134 for snapshot in ['analysis_server', 'dart2js', 'dartanalyzer', 'dartfmt', | 134 for snapshot in ['analysis_server', 'dart2js', 'dartanalyzer', 'dartfmt', |
135 'utils_wrapper', 'pub', 'dartdoc']: | 135 'utils_wrapper', 'pub', 'dartdoc']: |
136 snapshot += '.dart.snapshot' | 136 snapshot += '.dart.snapshot' |
137 copyfile(join(snapshots, snapshot), | 137 copyfile(join(snapshots, snapshot), |
138 join(sdk_root, 'bin', 'snapshots', snapshot)) | 138 join(sdk_root, 'bin', 'snapshots', snapshot)) |
139 | 139 |
140 def CopyDartdocResources(home,sdk_root): | 140 def CopyAnalyzerSources(home, lib_dir): |
141 for library in ['analyzer', 'analysis_server']: | |
142 copytree(join(home, 'pkg', library), join(lib_dir, library), | |
143 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh', | |
144 '.gitignore')) | |
145 | |
146 def CopyDartdocResources(home, sdk_root): | |
141 RESOURCE_DIR = join(sdk_root, 'bin', 'snapshots', 'resources') | 147 RESOURCE_DIR = join(sdk_root, 'bin', 'snapshots', 'resources') |
142 DARTDOC = join(RESOURCE_DIR, 'dartdoc') | 148 DARTDOC = join(RESOURCE_DIR, 'dartdoc') |
143 | 149 |
144 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'templates'), | 150 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'templates'), |
145 join(DARTDOC, 'templates')) | 151 join(DARTDOC, 'templates')) |
146 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'resources'), | 152 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'resources'), |
147 join(DARTDOC, 'resources')) | 153 join(DARTDOC, 'resources')) |
148 # write the .packages file | 154 # write the .packages file |
149 PACKAGES_FILE = join(DARTDOC, '.packages') | 155 PACKAGES_FILE = join(DARTDOC, '.packages') |
150 packages_file = open(PACKAGES_FILE, 'w') | 156 packages_file = open(PACKAGES_FILE, 'w') |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 ignore=ignore_patterns('.svn')) | 281 ignore=ignore_patterns('.svn')) |
276 | 282 |
277 # Copy in 7zip for Windows. | 283 # Copy in 7zip for Windows. |
278 if HOST_OS == 'win32': | 284 if HOST_OS == 'win32': |
279 copytree(join(HOME, 'third_party', '7zip'), | 285 copytree(join(HOME, 'third_party', '7zip'), |
280 join(RESOURCE, '7zip'), | 286 join(RESOURCE, '7zip'), |
281 ignore=ignore_patterns('.svn')) | 287 ignore=ignore_patterns('.svn')) |
282 | 288 |
283 # Copy dart2js/pub. | 289 # Copy dart2js/pub. |
284 CopyDartScripts(HOME, SDK_tmp) | 290 CopyDartScripts(HOME, SDK_tmp) |
291 | |
285 CopySnapshots(SNAPSHOT, SDK_tmp) | 292 CopySnapshots(SNAPSHOT, SDK_tmp) |
286 CopyDartdocResources(HOME, SDK_tmp) | 293 CopyDartdocResources(HOME, SDK_tmp) |
294 CopyAnalyzerSources(HOME, LIB) | |
287 | 295 |
288 # Write the 'version' file | 296 # Write the 'version' file |
289 version = utils.GetVersion() | 297 version = utils.GetVersion() |
290 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') | 298 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') |
291 versionFile.write(version + '\n') | 299 versionFile.write(version + '\n') |
292 versionFile.close() | 300 versionFile.close() |
293 | 301 |
294 # Write the 'revision' file | 302 # Write the 'revision' file |
295 revision = utils.GetGitRevision() | 303 revision = utils.GetGitRevision() |
296 | 304 |
297 if revision is not None: | 305 if revision is not None: |
298 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 306 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
299 f.write('%s\n' % revision) | 307 f.write('%s\n' % revision) |
300 f.close() | 308 f.close() |
301 | 309 |
302 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 310 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
303 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) | 311 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) |
304 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md') ) | 312 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md') ) |
305 | 313 |
306 move(SDK_tmp, SDK) | 314 move(SDK_tmp, SDK) |
307 | 315 |
308 if __name__ == '__main__': | 316 if __name__ == '__main__': |
309 sys.exit(Main()) | 317 sys.exit(Main()) |
OLD | NEW |