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

Side by Side Diff: tool/patch_sdk.dart

Issue 1228063003: fix for 1.12.0-dev SDK and 0.25.1 analyzer breaking changes (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
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(
50 sdkOut, '_internal', 'sdk_library_metadata', 'lib', 'libraries.dart'),
51 libContents);
49 _writeSync(path.join(sdkOut, '..', 'version'), 52 _writeSync(path.join(sdkOut, '..', 'version'),
50 new File(path.join(sdkLibIn, '..', 'version')).readAsStringSync()); 53 new File(path.join(sdkLibIn, '..', 'version')).readAsStringSync());
51 54
52 // Parse libraries.dart 55 // Parse libraries.dart
53 var sdkLibraries = _getSdkLibraries(libContents); 56 var sdkLibraries = _getSdkLibraries(libContents);
54 57
55 // Enumerate core libraries and apply patches 58 // Enumerate core libraries and apply patches
56 for (SdkLibrary library in sdkLibraries) { 59 for (SdkLibrary library in sdkLibraries) {
57 // TODO(jmesserly): analyzer does not handle the default case of 60 // TODO(jmesserly): analyzer does not handle the default case of
58 // "both platforms" correctly, and treats it as being supported on neither. 61 // "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; 393 if (diff != 0) return diff;
391 return end - other.end; 394 return end - other.end;
392 } 395 }
393 } 396 }
394 397
395 List<SdkLibrary> _getSdkLibraries(String contents) { 398 List<SdkLibrary> _getSdkLibraries(String contents) {
396 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); 399 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true);
397 parseCompilationUnit(contents).accept(libraryBuilder); 400 parseCompilationUnit(contents).accept(libraryBuilder);
398 return libraryBuilder.librariesMap.sdkLibraries; 401 return libraryBuilder.librariesMap.sdkLibraries;
399 } 402 }
OLDNEW
« pubspec.yaml ('K') | « test/checker/checker_test.dart ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698