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

Unified Diff: dart/tools/create_sdk.py

Issue 10266011: Shoehorn dart2js into the SDK. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/lib/compiler/implementation/filenames.dart ('k') | dart/tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/create_sdk.py
diff --git a/dart/tools/create_sdk.py b/dart/tools/create_sdk.py
index 4c573d80acf0c17927ef188f95957b2f3f22f0bc..312551a88938090e3c3d3c344c5b3e9453398c35 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 the layout of the part of the repository we're
+ dealing with here which frees us from rewriting 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:
« no previous file with comments | « dart/lib/compiler/implementation/filenames.dart ('k') | dart/tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698