Chromium Code Reviews| Index: dart/tools/create_sdk.py |
| diff --git a/dart/tools/create_sdk.py b/dart/tools/create_sdk.py |
| index 4c573d80acf0c17927ef188f95957b2f3f22f0bc..e813e57f9c6aec5ee19809db5c2a5f881e055d58 100755 |
| --- a/dart/tools/create_sdk.py |
| +++ b/dart/tools/create_sdk.py |
| @@ -74,6 +74,49 @@ def ReplaceInFiles(paths, subs): |
| dest.write(contents) |
| dest.close() |
| + |
| +def Copy(src, dest): |
| + copyfile(src, dest) |
| + copymode(src, dest) |
| + |
| + |
| +def CopyDart2Js(build_dir, sdk_root): |
| + ''' |
| + Install dart2js in SDK/lib/dart2js. |
| + |
| + Currently, we copy too much stuff to this location, but the SDK's |
| + layout matches the repository's which frees us from rewriting |
|
kasperl
2012/05/02 11:20:46
the repository's -> the layout of the part of the
|
| + files. The long term plan is to align the layout of the repository |
| + and the SDK, at which point we should be able to simplify Main below |
| + and share the dart files between the various components to minimize |
| + SDK download size. |
| + ''' |
| + copytree('lib', os.path.join(sdk_root, 'lib', 'dart2js', 'lib'), |
| + ignore=ignore_patterns('.svn')) |
| + copytree(os.path.join('corelib', 'src'), |
| + os.path.join(sdk_root, 'lib', 'dart2js', 'corelib', 'src'), |
| + ignore=ignore_patterns('.svn')) |
| + copytree(os.path.join('runtime', 'lib'), |
| + os.path.join(sdk_root, 'lib', 'dart2js', 'runtime', 'lib'), |
| + ignore=ignore_patterns('.svn')) |
| + copytree(os.path.join('runtime', 'bin'), |
| + os.path.join(sdk_root, 'lib', 'dart2js', 'runtime', 'bin'), |
| + ignore=ignore_patterns('.svn')) |
| + if utils.GuessOS() == 'win32': |
| + dart2js = os.path.join(sdk_root, 'bin', 'dart2js.bat') |
| + Copy(os.path.join(build_dir, 'dart2js.bat'), dart2js) |
| + ReplaceInFiles([dart2js], |
| + [(r'%SCRIPTPATH%\.\.\\lib', |
| + r'%SCRIPTPATH%..\lib\dart2js\lib')]) |
| + else: |
| + dart2js = os.path.join(sdk_root, 'bin', 'dart2js') |
| + Copy(os.path.join(build_dir, 'dart2js'), dart2js) |
| + ReplaceInFiles([dart2js], |
| + [(r'\$BIN_DIR/\.\./\.\./lib', |
| + r'$BIN_DIR/../lib/dart2js/lib')]) |
| + |
| + |
| + |
| def Main(argv): |
| # Pull in all of the gpyi files which will be munged into the sdk. |
| builtin_runtime_sources = \ |
| @@ -424,6 +467,8 @@ def Main(argv): |
| import_dst = join(LIB, 'config', 'import_' + platform + '.config') |
| copyfile(import_src, import_dst); |
| + CopyDart2Js(build_dir, SDK_tmp) |
| + |
| # Write the 'revision' file |
| revision = utils.GetSVNRevision() |
| if revision is not None: |