OLD | NEW |
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 | 8 |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 for (var file in ['loader.dart', 'server.dart', 'vmservice_io.dart']) { | 190 for (var file in ['loader.dart', 'server.dart', 'vmservice_io.dart']) { |
191 var libraryIn = path.join(dartDir, 'runtime', 'bin', 'vmservice', file); | 191 var libraryIn = path.join(dartDir, 'runtime', 'bin', 'vmservice', file); |
192 var libraryOut = path.join(sdkOut, 'vmservice_io', file); | 192 var libraryOut = path.join(sdkOut, 'vmservice_io', file); |
193 _writeSync(libraryOut, new File(libraryIn).readAsStringSync()); | 193 _writeSync(libraryOut, new File(libraryIn).readAsStringSync()); |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
197 await compile_platform.main(<String>[ | 197 await compile_platform.main(<String>[ |
198 '--packages', packagesFile, sdkOut, path.join(sdkOut, 'platform.dill') | 198 '--packages', |
| 199 new Uri.file(packagesFile).toString(), |
| 200 sdkOut, |
| 201 path.join(sdkOut, 'platform.dill') |
199 ]); | 202 ]); |
200 } | 203 } |
201 | 204 |
202 /// Writes a file, creating the directory if needed. | 205 /// Writes a file, creating the directory if needed. |
203 void _writeSync(String filePath, String contents) { | 206 void _writeSync(String filePath, String contents) { |
204 var outDir = new Directory(path.dirname(filePath)); | 207 var outDir = new Directory(path.dirname(filePath)); |
205 if (!outDir.existsSync()) outDir.createSync(recursive: true); | 208 if (!outDir.existsSync()) outDir.createSync(recursive: true); |
206 | 209 |
207 new File(filePath).writeAsStringSync(contents); | 210 new File(filePath).writeAsStringSync(contents); |
208 } | 211 } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 if (diff != 0) return diff; | 536 if (diff != 0) return diff; |
534 return end - other.end; | 537 return end - other.end; |
535 } | 538 } |
536 } | 539 } |
537 | 540 |
538 List<SdkLibrary> _getSdkLibraries(String contents) { | 541 List<SdkLibrary> _getSdkLibraries(String contents) { |
539 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); | 542 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); |
540 parseCompilationUnit(contents).accept(libraryBuilder); | 543 parseCompilationUnit(contents).accept(libraryBuilder); |
541 return libraryBuilder.librariesMap.sdkLibraries; | 544 return libraryBuilder.librariesMap.sdkLibraries; |
542 } | 545 } |
OLD | NEW |