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

Side by Side Diff: tools/patch_sdk.dart

Issue 2709033005: In patch_sdk when passing --packages down to fasta turn it into an URI. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698