OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2016, 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 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'batch_util.dart'; | 9 import 'batch_util.dart'; |
10 | 10 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 return fail('Exactly one FILE should be given.'); | 255 return fail('Exactly one FILE should be given.'); |
256 } | 256 } |
257 | 257 |
258 var file = options.rest.single; | 258 var file = options.rest.single; |
259 | 259 |
260 checkIsFile(file, option: 'Input file'); | 260 checkIsFile(file, option: 'Input file'); |
261 | 261 |
262 String format = options['format'] ?? defaultFormat(); | 262 String format = options['format'] ?? defaultFormat(); |
263 String outputFile = options['out'] ?? defaultOutput(); | 263 String outputFile = options['out'] ?? defaultOutput(); |
264 | 264 |
265 var customUriMappings = parseCustomUriMappings(options['url-mapping']); | 265 List<String> urlMapping = options['url-mapping'] as List<String>; |
| 266 var customUriMappings = parseCustomUriMappings(urlMapping); |
266 var repository = new Repository(); | 267 var repository = new Repository(); |
267 | 268 |
268 Program program; | 269 Program program; |
269 | 270 |
270 var watch = new Stopwatch()..start(); | 271 var watch = new Stopwatch()..start(); |
271 List<String> loadedFiles; | 272 List<String> loadedFiles; |
272 Function getLoadedFiles; | 273 Function getLoadedFiles; |
273 List errors = const []; | 274 List errors = const []; |
274 TargetFlags targetFlags = new TargetFlags(strongMode: options['strong']); | 275 TargetFlags targetFlags = new TargetFlags(strongMode: options['strong']); |
275 Target target = getTarget(options['target'], targetFlags); | 276 Target target = getTarget(options['target'], targetFlags); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 373 |
373 await ioFuture; | 374 await ioFuture; |
374 | 375 |
375 if (shouldReportMetrics) { | 376 if (shouldReportMetrics) { |
376 int flushTime = watch.elapsedMilliseconds - time; | 377 int flushTime = watch.elapsedMilliseconds - time; |
377 print('writer.flush_time = $flushTime ms'); | 378 print('writer.flush_time = $flushTime ms'); |
378 } | 379 } |
379 | 380 |
380 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok; | 381 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok; |
381 } | 382 } |
OLD | NEW |