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

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

Issue 368383002: Revert revision 38013 and revision 38011 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« 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 // 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 /// Definitions used to run the polymer linter and deploy tools without using 5 /// Definitions used to run the polymer linter and deploy tools without using
6 /// pub serve or pub deploy. 6 /// pub serve or pub deploy.
7 library polymer.src.build.runner; 7 library polymer.src.build.runner;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 import 'dart:convert'; 10 import 'dart:convert';
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 209 }
210 }); 210 });
211 } 211 }
212 212
213 /// Emits all outputs of [barback] and copies files that we didn't process (like 213 /// Emits all outputs of [barback] and copies files that we didn't process (like
214 /// dependent package's libraries). 214 /// dependent package's libraries).
215 Future _emitAllFiles(Barback barback, BarbackOptions options) { 215 Future _emitAllFiles(Barback barback, BarbackOptions options) {
216 return barback.getAllAssets().then((assets) { 216 return barback.getAllAssets().then((assets) {
217 // Delete existing output folder before we generate anything 217 // Delete existing output folder before we generate anything
218 var dir = new Directory(options.outDir); 218 var dir = new Directory(options.outDir);
219 // We get very long filenames which can cause us to not be able to delete 219 if (dir.existsSync()) dir.deleteSync(recursive: true);
220 // using the normal dart:io deleteSync(recursive: true) on windows
221 if (dir.existsSync()) {
222 if (Platform.operatingSystem == 'windows' ) {
223 var result = Process.runSync('rmdir', ['/q', '/s', options.outDir],
224 runInShell: true);
225 if (result.exitCode != 0) {
226 throw "Could not delete $dir, output was: \n"
227 "stdout: ${result.stdout} \n"
228 "stderr: ${result.stderr}";
229 }
230 } else {
231 dir.deleteSync(recursive: true);
232 }
233 }
234 return _emitPackagesDir(options) 220 return _emitPackagesDir(options)
235 .then((_) => _emitTransformedFiles(assets, options)) 221 .then((_) => _emitTransformedFiles(assets, options))
236 .then((_) => _addPackagesSymlinks(assets, options)) 222 .then((_) => _addPackagesSymlinks(assets, options))
237 .then((_) => assets); 223 .then((_) => assets);
238 }); 224 });
239 } 225 }
240 226
241 Future _emitTransformedFiles(AssetSet assets, BarbackOptions options) { 227 Future _emitTransformedFiles(AssetSet assets, BarbackOptions options) {
242 // Copy all the assets we transformed 228 // Copy all the assets we transformed
243 var futures = []; 229 var futures = [];
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 output.write(entry.span.getLocationMessage(entry.message, 361 output.write(entry.span.getLocationMessage(entry.message,
376 useColors: useColors, 362 useColors: useColors,
377 color: levelColor)); 363 color: levelColor));
378 } 364 }
379 return output.toString(); 365 return output.toString();
380 } 366 }
381 367
382 const String _RED_COLOR = '\u001b[31m'; 368 const String _RED_COLOR = '\u001b[31m';
383 const String _MAGENTA_COLOR = '\u001b[35m'; 369 const String _MAGENTA_COLOR = '\u001b[35m';
384 const String _NO_COLOR = '\u001b[0m'; 370 const String _NO_COLOR = '\u001b[0m';
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