Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: tools/create_sdk.py

Issue 8825011: Add frogc shell script for SDK. ≈ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« frog/frogc ('K') | « frog/frogc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 rmtree(SDK) 96 rmtree(SDK)
97 97
98 # Create and populate sdk/bin. 98 # Create and populate sdk/bin.
99 BIN = join(SDK_tmp, 'bin') 99 BIN = join(SDK_tmp, 'bin')
100 os.makedirs(BIN) 100 os.makedirs(BIN)
101 101
102 # Copy the Dart VM binary into sdk/bin. 102 # Copy the Dart VM binary into sdk/bin.
103 # TODO(dgrove) - deal with architectures that are not ia32. 103 # TODO(dgrove) - deal with architectures that are not ia32.
104 build_dir = utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32') 104 build_dir = utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32')
105 if utils.GuessOS() == 'win32': 105 if utils.GuessOS() == 'win32':
106 dart_src_binary = join(join(HOME, build_dir), 'dart.exe') 106 # TODO(dgrove) - deal with frogc.bat
107 dart_src_binary = join(HOME, build_dir, 'dart.exe')
107 dart_dest_binary = join(BIN, 'dart.exe') 108 dart_dest_binary = join(BIN, 'dart.exe')
108 else: 109 else:
109 dart_src_binary = join(join(HOME, build_dir), 'dart') 110 frogc_src_binary = join(HOME, 'frog', 'frogc')
111 dart_src_binary = join(HOME, build_dir, 'dart')
110 dart_dest_binary = join(BIN, 'dart') 112 dart_dest_binary = join(BIN, 'dart')
113 frogc_dest_binary = join(BIN, 'frogc')
111 copyfile(dart_src_binary, dart_dest_binary) 114 copyfile(dart_src_binary, dart_dest_binary)
112 copymode(dart_src_binary, dart_dest_binary) 115 copymode(dart_src_binary, dart_dest_binary)
116 copyfile(frogc_src_binary, frogc_dest_binary)
117 copymode(frogc_src_binary, frogc_dest_binary)
113 118
114 # Create sdk/bin/frogc.dart, and hack as needed. 119 # Create sdk/bin/frogc.dart, and hack as needed.
115 frog_src_dir = join(HOME, 'frog') 120 frog_src_dir = join(HOME, 'frog')
116 121
117 # Convert frogc.dart's imports from import('*') -> import('frog/*'). 122 # Convert frogc.dart's imports from import('*') -> import('frog/*').
118 frogc_contents = open(join(frog_src_dir, 'frogc.dart')).read() 123 frogc_contents = open(join(frog_src_dir, 'frogc.dart')).read()
119 frogc_dest = open(join(BIN, 'frogc.dart'), 'w') 124 frogc_dest = open(join(BIN, 'frogc.dart'), 'w')
120 frogc_dest.write( 125 frogc_dest.write(
121 re.sub("#import\('", "#import('../lib/frog/", frogc_contents)) 126 re.sub("#import\('", "#import('../lib/frog/", frogc_contents))
122 frogc_dest.close() 127 frogc_dest.close()
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 os.makedirs(UTIL) 366 os.makedirs(UTIL)
362 367
363 copytree(join(HOME, 'utils', 'dartdoc'), join(UTIL, 'dartdoc'), 368 copytree(join(HOME, 'utils', 'dartdoc'), join(UTIL, 'dartdoc'),
364 ignore=ignore_patterns('.svn')) 369 ignore=ignore_patterns('.svn'))
365 370
366 copytree(SDK_tmp, SDK) 371 copytree(SDK_tmp, SDK)
367 rmtree(SDK_tmp) 372 rmtree(SDK_tmp)
368 373
369 if __name__ == '__main__': 374 if __name__ == '__main__':
370 sys.exit(Main(sys.argv)) 375 sys.exit(Main(sys.argv))
OLDNEW
« frog/frogc ('K') | « frog/frogc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698