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

Side by Side Diff: tool/patch_sdk.dart

Issue 1231643009: create another copy of libraries.dart for 1.12-dev SDK (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « .gitignore ('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 dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 /// Command line tool to merge the SDK libraries and our patch files. 6 /// Command line tool to merge the SDK libraries and our patch files.
7 /// This is currently designed as an offline tool, but we could automate it. 7 /// This is currently designed as an offline tool, but we could automate it.
8 library dev_compiler.tool.patch_sdk; 8 library dev_compiler.tool.patch_sdk;
9 9
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 28 matching lines...) Expand all
39 var sdkOut = path.join(argv[1], 'lib'); 39 var sdkOut = path.join(argv[1], 'lib');
40 var privateLibOut = 40 var privateLibOut =
41 path.normalize(path.join(sdkOut, '_internal', 'compiler', 'js_lib')); 41 path.normalize(path.join(sdkOut, '_internal', 'compiler', 'js_lib'));
42 42
43 var INTERNAL_PATH = '_internal/compiler/js_lib/'; 43 var INTERNAL_PATH = '_internal/compiler/js_lib/';
44 44
45 // Copy libraries.dart and version 45 // Copy libraries.dart and version
46 var libContents = new File(path.join(sdkLibIn, '_internal', 'libraries.dart')) 46 var libContents = new File(path.join(sdkLibIn, '_internal', 'libraries.dart'))
47 .readAsStringSync(); 47 .readAsStringSync();
48 _writeSync(path.join(sdkOut, '_internal', 'libraries.dart'), libContents); 48 _writeSync(path.join(sdkOut, '_internal', 'libraries.dart'), libContents);
49 _writeSync(path.join(sdkOut, '_internal', 'sdk_library_metadata', 'lib', 'libr aries.dart'), libContents);
49 _writeSync(path.join(sdkOut, '..', 'version'), 50 _writeSync(path.join(sdkOut, '..', 'version'),
50 new File(path.join(sdkLibIn, '..', 'version')).readAsStringSync()); 51 new File(path.join(sdkLibIn, '..', 'version')).readAsStringSync());
51 52
52 // Parse libraries.dart 53 // Parse libraries.dart
53 var sdkLibraries = _getSdkLibraries(libContents); 54 var sdkLibraries = _getSdkLibraries(libContents);
54 55
55 // Enumerate core libraries and apply patches 56 // Enumerate core libraries and apply patches
56 for (SdkLibrary library in sdkLibraries) { 57 for (SdkLibrary library in sdkLibraries) {
57 // TODO(jmesserly): analyzer does not handle the default case of 58 // TODO(jmesserly): analyzer does not handle the default case of
58 // "both platforms" correctly, and treats it as being supported on neither. 59 // "both platforms" correctly, and treats it as being supported on neither.
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 if (diff != 0) return diff; 391 if (diff != 0) return diff;
391 return end - other.end; 392 return end - other.end;
392 } 393 }
393 } 394 }
394 395
395 List<SdkLibrary> _getSdkLibraries(String contents) { 396 List<SdkLibrary> _getSdkLibraries(String contents) {
396 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); 397 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true);
397 parseCompilationUnit(contents).accept(libraryBuilder); 398 parseCompilationUnit(contents).accept(libraryBuilder);
398 return libraryBuilder.librariesMap.sdkLibraries; 399 return libraryBuilder.librariesMap.sdkLibraries;
399 } 400 }
OLDNEW
« no previous file with comments | « .gitignore ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698