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

Side by Side Diff: pkg/polymer/lib/src/build/runner.dart

Issue 52883002: Remove uses of Options in polymer lint and deploy tools. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« pkg/polymer/lib/builder.dart ('K') | « pkg/polymer/lib/deploy.dart ('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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Definitions used to run the polymer linter and deploy tools without using 6 * Definitions used to run the polymer linter and deploy tools without using
7 * pub serve or pub deploy. 7 * pub serve or pub deploy.
8 */ 8 */
9 library polymer.src.build.runner; 9 library polymer.src.build.runner;
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 return loadYaml(pubspec.readAsStringSync())['name']; 76 return loadYaml(pubspec.readAsStringSync())['name'];
77 } 77 }
78 78
79 /** 79 /**
80 * Extract a mapping between package names and the path in the file system where 80 * Extract a mapping between package names and the path in the file system where
81 * to find the sources of such package. This map will contain an entry for the 81 * to find the sources of such package. This map will contain an entry for the
82 * current package and everything it depends on (extracted via `pub 82 * current package and everything it depends on (extracted via `pub
83 * list-pacakge-dirs`). 83 * list-pacakge-dirs`).
84 */ 84 */
85 Map<String, String> _readPackageDirsFromPub(String currentPackage) { 85 Map<String, String> _readPackageDirsFromPub(String currentPackage) {
86 var dartExec = new Options().executable; 86 var dartExec = Platform.executable;
87 // If dartExec == dart, then dart and pub are in standard PATH. 87 // If dartExec == dart, then dart and pub are in standard PATH.
88 var sdkDir = dartExec == 'dart' ? '' : path.dirname(dartExec); 88 var sdkDir = dartExec == 'dart' ? '' : path.dirname(dartExec);
89 var pub = path.join(sdkDir, Platform.isWindows ? 'pub.bat' : 'pub'); 89 var pub = path.join(sdkDir, Platform.isWindows ? 'pub.bat' : 'pub');
90 var result = Process.runSync(pub, ['list-package-dirs']); 90 var result = Process.runSync(pub, ['list-package-dirs']);
91 if (result.exitCode != 0) { 91 if (result.exitCode != 0) {
92 print("unexpected error invoking 'pub':"); 92 print("unexpected error invoking 'pub':");
93 print(result.stdout); 93 print(result.stdout);
94 print(result.stderr); 94 print(result.stderr);
95 exit(result.exitCode); 95 exit(result.exitCode);
96 } 96 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 Future _copyFile(String inpath, String outpath) { 303 Future _copyFile(String inpath, String outpath) {
304 _ensureDir(path.dirname(outpath)); 304 _ensureDir(path.dirname(outpath));
305 return new File(inpath).openRead().pipe(new File(outpath).openWrite()); 305 return new File(inpath).openRead().pipe(new File(outpath).openWrite());
306 } 306 }
307 307
308 /** Write contents of an [asset] into a file at [filepath]. */ 308 /** Write contents of an [asset] into a file at [filepath]. */
309 Future _writeAsset(String filepath, Asset asset) { 309 Future _writeAsset(String filepath, Asset asset) {
310 _ensureDir(path.dirname(filepath)); 310 _ensureDir(path.dirname(filepath));
311 return asset.read().pipe(new File(filepath).openWrite()); 311 return asset.read().pipe(new File(filepath).openWrite());
312 } 312 }
OLDNEW
« pkg/polymer/lib/builder.dart ('K') | « pkg/polymer/lib/deploy.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698