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

Side by Side Diff: tool/patch_sdk.dart

Issue 1270993002: fixes #276, path manipulation issues on windows. Also fixes server mode (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix comment Created 5 years, 4 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 | « test/codegen/expect/sunflower/sunflower.html ('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';
11 11
12 import 'package:analyzer/analyzer.dart'; 12 import 'package:analyzer/analyzer.dart';
13 import 'package:analyzer/src/generated/sdk.dart'; 13 import 'package:analyzer/src/generated/sdk.dart';
14 import 'package:path/path.dart' as path; 14 import 'package:path/path.dart' as path;
15 15
16 void main(List<String> argv) { 16 void main(List<String> argv) {
17 if (argv.length < 2) { 17 if (argv.length < 2) {
18 var self = path.relative(Platform.script.path); 18 var self = path.relative(path.fromUri(Platform.script));
19 var toolDir = path.relative(path.dirname(Platform.script.path)); 19 var toolDir = path.relative(path.dirname(path.fromUri(Platform.script)));
20 20
21 var inputExample = path.join(toolDir, 'input_sdk'); 21 var inputExample = path.join(toolDir, 'input_sdk');
22 var outExample = path.relative( 22 var outExample = path.relative(
23 path.normalize(path.join(toolDir, '..', 'test', 'generated_sdk'))); 23 path.normalize(path.join(toolDir, '..', 'test', 'generated_sdk')));
24 24
25 print('Usage: $self INPUT_DIR OUTPUT_DIR'); 25 print('Usage: $self INPUT_DIR OUTPUT_DIR');
26 print('For example:'); 26 print('For example:');
27 print('\$ $self $inputExample $outExample'); 27 print('\$ $self $inputExample $outExample');
28 28
29 inputExample = path.join(toolDir, 'min_sdk'); 29 inputExample = path.join(toolDir, 'min_sdk');
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 if (diff != 0) return diff; 392 if (diff != 0) return diff;
393 return end - other.end; 393 return end - other.end;
394 } 394 }
395 } 395 }
396 396
397 List<SdkLibrary> _getSdkLibraries(String contents) { 397 List<SdkLibrary> _getSdkLibraries(String contents) {
398 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); 398 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true);
399 parseCompilationUnit(contents).accept(libraryBuilder); 399 parseCompilationUnit(contents).accept(libraryBuilder);
400 return libraryBuilder.librariesMap.sdkLibraries; 400 return libraryBuilder.librariesMap.sdkLibraries;
401 } 401 }
OLDNEW
« no previous file with comments | « test/codegen/expect/sunflower/sunflower.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698