| 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:convert' show UTF8, LineSplitter; | 9 import 'dart:convert' show UTF8, LineSplitter; |
| 10 import 'dart:io' | 10 import 'dart:io' |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 new OptionHandler('--suppress-warnings', (_) { | 295 new OptionHandler('--suppress-warnings', (_) { |
| 296 diagnosticHandler.showWarnings = false; | 296 diagnosticHandler.showWarnings = false; |
| 297 passThrough('--suppress-warnings'); | 297 passThrough('--suppress-warnings'); |
| 298 }), | 298 }), |
| 299 new OptionHandler('--fatal-warnings', passThrough), | 299 new OptionHandler('--fatal-warnings', passThrough), |
| 300 new OptionHandler('--suppress-hints', | 300 new OptionHandler('--suppress-hints', |
| 301 (_) => diagnosticHandler.showHints = false), | 301 (_) => diagnosticHandler.showHints = false), |
| 302 new OptionHandler( | 302 new OptionHandler( |
| 303 '--output-type=dart|--output-type=dart-multi|--output-type=js', | 303 '--output-type=dart|--output-type=dart-multi|--output-type=js', |
| 304 setOutputType), | 304 setOutputType), |
| 305 new OptionHandler('--use-cps-ir', passThrough), |
| 305 new OptionHandler('--verbose', setVerbose), | 306 new OptionHandler('--verbose', setVerbose), |
| 306 new OptionHandler('--version', (_) => wantVersion = true), | 307 new OptionHandler('--version', (_) => wantVersion = true), |
| 307 new OptionHandler('--library-root=.+', setLibraryRoot), | 308 new OptionHandler('--library-root=.+', setLibraryRoot), |
| 308 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), | 309 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), |
| 309 new OptionHandler('--allow-mock-compilation', passThrough), | 310 new OptionHandler('--allow-mock-compilation', passThrough), |
| 310 new OptionHandler('--minify|-m', implyCompilation), | 311 new OptionHandler('--minify|-m', implyCompilation), |
| 311 new OptionHandler('--preserve-uris', passThrough), | 312 new OptionHandler('--preserve-uris', passThrough), |
| 312 new OptionHandler('--force-strip=.*', setStrip), | 313 new OptionHandler('--force-strip=.*', setStrip), |
| 313 new OptionHandler('--disable-diagnostic-colors', | 314 new OptionHandler('--disable-diagnostic-colors', |
| 314 (_) => diagnosticHandler.enableColors = false), | 315 (_) => diagnosticHandler.enableColors = false), |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 --dump-info | 624 --dump-info |
| 624 Generates an out.info.json file with information about the generated code. | 625 Generates an out.info.json file with information about the generated code. |
| 625 You can inspect the generated file with the viewer at: | 626 You can inspect the generated file with the viewer at: |
| 626 https://dart-lang.github.io/dump-info-visualizer/ | 627 https://dart-lang.github.io/dump-info-visualizer/ |
| 627 This feature is currently not supported in combination with the | 628 This feature is currently not supported in combination with the |
| 628 '--output-type=dart' option. | 629 '--output-type=dart' option. |
| 629 | 630 |
| 630 --generate-code-with-compile-time-errors | 631 --generate-code-with-compile-time-errors |
| 631 Generates output even if the program contains compile-time errors. Use the | 632 Generates output even if the program contains compile-time errors. Use the |
| 632 exit code to determine if compilation failed. | 633 exit code to determine if compilation failed. |
| 634 |
| 635 --use-cps-ir |
| 636 Experimental. Use the new CPS based backend for code generation. |
| 633 '''.trim()); | 637 '''.trim()); |
| 634 } | 638 } |
| 635 | 639 |
| 636 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { | 640 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { |
| 637 if (wantVersion) { | 641 if (wantVersion) { |
| 638 var version = (BUILD_ID == null) | 642 var version = (BUILD_ID == null) |
| 639 ? '<non-SDK build>' | 643 ? '<non-SDK build>' |
| 640 : BUILD_ID; | 644 : BUILD_ID; |
| 641 print('Dart-to-JavaScript compiler (dart2js) version: $version'); | 645 print('Dart-to-JavaScript compiler (dart2js) version: $version'); |
| 642 } | 646 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 } else if (exitCode == 253) { | 741 } else if (exitCode == 253) { |
| 738 print(">>> TEST CRASH"); | 742 print(">>> TEST CRASH"); |
| 739 } else { | 743 } else { |
| 740 print(">>> TEST FAIL"); | 744 print(">>> TEST FAIL"); |
| 741 } | 745 } |
| 742 stderr.writeln(">>> EOF STDERR"); | 746 stderr.writeln(">>> EOF STDERR"); |
| 743 subscription.resume(); | 747 subscription.resume(); |
| 744 }); | 748 }); |
| 745 }); | 749 }); |
| 746 } | 750 } |
| OLD | NEW |