| 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' show EventSink, Future; | 7 import 'dart:async' show EventSink, Future; |
| 8 import 'dart:convert' show UTF8, LineSplitter; | 8 import 'dart:convert' show UTF8, LineSplitter; |
| 9 import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr; | 9 import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr; |
| 10 | 10 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 diagnosticHandler.info( | 464 diagnosticHandler.info( |
| 465 "Option '${Flags.analyzeAll}' implies '${Flags.analyzeOnly}'.", | 465 "Option '${Flags.analyzeAll}' implies '${Flags.analyzeOnly}'.", |
| 466 api.Diagnostic.INFO); | 466 api.Diagnostic.INFO); |
| 467 } | 467 } |
| 468 diagnosticHandler.info( | 468 diagnosticHandler.info( |
| 469 "Options $optionsImplyOutput indicate that output is expected, " | 469 "Options $optionsImplyOutput indicate that output is expected, " |
| 470 "but compilation is turned off by the option '${Flags.analyzeOnly}'.", | 470 "but compilation is turned off by the option '${Flags.analyzeOnly}'.", |
| 471 api.Diagnostic.INFO); | 471 api.Diagnostic.INFO); |
| 472 } | 472 } |
| 473 if (resolveOnly) { | 473 if (resolveOnly) { |
| 474 if (resolutionInputs.contains(resolutionOutput)) { | 474 if (resolutionInputs != null && |
| 475 resolutionInputs.contains(resolutionOutput)) { |
| 475 helpAndFail("Resolution input '${resolutionOutput}' can't be used as " | 476 helpAndFail("Resolution input '${resolutionOutput}' can't be used as " |
| 476 "resolution output. Use the '--out' option to specify another " | 477 "resolution output. Use the '--out' option to specify another " |
| 477 "resolution output."); | 478 "resolution output."); |
| 478 } | 479 } |
| 479 analyzeOnly = analyzeAll = true; | 480 analyzeOnly = analyzeAll = true; |
| 480 } else if (analyzeAll) { | 481 } else if (analyzeAll) { |
| 481 analyzeOnly = true; | 482 analyzeOnly = true; |
| 482 } | 483 } |
| 483 if (!analyzeOnly) { | 484 if (!analyzeOnly) { |
| 484 if (allowNativeExtensions) { | 485 if (allowNativeExtensions) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 } | 529 } |
| 529 | 530 |
| 530 Uri script = currentDirectory.resolve(arguments[0]); | 531 Uri script = currentDirectory.resolve(arguments[0]); |
| 531 CompilerOptions compilerOptions = new CompilerOptions.parse( | 532 CompilerOptions compilerOptions = new CompilerOptions.parse( |
| 532 entryPoint: script, | 533 entryPoint: script, |
| 533 libraryRoot: libraryRoot, | 534 libraryRoot: libraryRoot, |
| 534 packageRoot: packageRoot, | 535 packageRoot: packageRoot, |
| 535 packageConfig: packageConfig, | 536 packageConfig: packageConfig, |
| 536 packagesDiscoveryProvider: findPackages, | 537 packagesDiscoveryProvider: findPackages, |
| 537 resolutionInputs: resolutionInputs, | 538 resolutionInputs: resolutionInputs, |
| 538 resolutionOutput: resolutionOutput, | 539 resolutionOutput: resolveOnly ? resolutionOutput: null, |
| 539 options: options, | 540 options: options, |
| 540 environment: environment); | 541 environment: environment); |
| 541 return compileFunc( | 542 return compileFunc( |
| 542 compilerOptions, inputProvider, diagnosticHandler, outputProvider) | 543 compilerOptions, inputProvider, diagnosticHandler, outputProvider) |
| 543 .then(compilationDone); | 544 .then(compilationDone); |
| 544 } | 545 } |
| 545 | 546 |
| 546 class AbortLeg { | 547 class AbortLeg { |
| 547 final message; | 548 final message; |
| 548 AbortLeg(this.message); | 549 AbortLeg(this.message); |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 @override | 1021 @override |
| 1021 void close() { | 1022 void close() { |
| 1022 // Do nothing. | 1023 // Do nothing. |
| 1023 } | 1024 } |
| 1024 | 1025 |
| 1025 @override | 1026 @override |
| 1026 void addError(errorEvent, [StackTrace stackTrace]) { | 1027 void addError(errorEvent, [StackTrace stackTrace]) { |
| 1027 // Ignore | 1028 // Ignore |
| 1028 } | 1029 } |
| 1029 } | 1030 } |
| OLD | NEW |