| OLD | NEW |
| 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 library dart2js.cmdline; | 5 library dart2js.cmdline; |
| 6 | 6 |
| 7 import 'dart:async' | 7 import 'dart:async' |
| 8 show Future, EventSink; | 8 show Future, EventSink; |
| 9 import 'dart:io' | 9 import 'dart:io' |
| 10 show exit, File, FileMode, Platform, RandomAccessFile, FileSystemException; | 10 show exit, File, FileMode, Platform, RandomAccessFile, FileSystemException; |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 int totalCharactersWritten = 0; | 359 int totalCharactersWritten = 0; |
| 360 | 360 |
| 361 options.add('--out=$out'); | 361 options.add('--out=$out'); |
| 362 options.add('--source-map=$sourceMapOut'); | 362 options.add('--source-map=$sourceMapOut'); |
| 363 | 363 |
| 364 List<String> allOutputFiles = new List<String>(); | 364 List<String> allOutputFiles = new List<String>(); |
| 365 | 365 |
| 366 compilationDone(String code) { | 366 compilationDone(String code) { |
| 367 if (analyzeOnly) return; | 367 if (analyzeOnly) return; |
| 368 writeString(Uri.parse('$out.deps'), |
| 369 getDepsOutput(inputProvider.sourceFiles)); |
| 368 if (code == null) { | 370 if (code == null) { |
| 369 fail('Compilation failed.'); | 371 fail('Compilation failed.'); |
| 370 } | 372 } |
| 371 writeString(Uri.parse('$out.deps'), | |
| 372 getDepsOutput(inputProvider.sourceFiles)); | |
| 373 diagnosticHandler.info( | 373 diagnosticHandler.info( |
| 374 'Compiled ${inputProvider.dartCharactersRead} characters Dart ' | 374 'Compiled ${inputProvider.dartCharactersRead} characters Dart ' |
| 375 '-> $totalCharactersWritten characters $outputLanguage ' | 375 '-> $totalCharactersWritten characters $outputLanguage ' |
| 376 'in ${relativize(currentDirectory, out, isWindows)}'); | 376 'in ${relativize(currentDirectory, out, isWindows)}'); |
| 377 if (diagnosticHandler.verbose) { | 377 if (diagnosticHandler.verbose) { |
| 378 String input = uriPathToNative(arguments[0]); | 378 String input = uriPathToNative(arguments[0]); |
| 379 print('Dart file ($input) compiled to $outputLanguage.'); | 379 print('Dart file ($input) compiled to $outputLanguage.'); |
| 380 print('Wrote the following files:'); | 380 print('Wrote the following files:'); |
| 381 for (String filename in allOutputFiles) { | 381 for (String filename in allOutputFiles) { |
| 382 print(" $filename"); | 382 print(" $filename"); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 } | 663 } |
| 664 } | 664 } |
| 665 | 665 |
| 666 try { | 666 try { |
| 667 return compilerMain(arguments).catchError(onError); | 667 return compilerMain(arguments).catchError(onError); |
| 668 } catch (exception, trace) { | 668 } catch (exception, trace) { |
| 669 onError(exception, trace); | 669 onError(exception, trace); |
| 670 return new Future.value(); | 670 return new Future.value(); |
| 671 } | 671 } |
| 672 } | 672 } |
| OLD | NEW |