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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool showWarnings; | 131 bool showWarnings; |
132 bool showHints; | 132 bool showHints; |
133 bool enableColors; | 133 bool enableColors; |
134 // List of provided options that imply that output is expected. | 134 // List of provided options that imply that output is expected. |
135 List<String> optionsImplyCompilation = <String>[]; | 135 List<String> optionsImplyCompilation = <String>[]; |
136 bool hasDisallowUnsafeEval = false; | 136 bool hasDisallowUnsafeEval = false; |
137 Map<String, dynamic> environment = new Map<String, dynamic>(); | 137 Map<String, dynamic> environment = new Map<String, dynamic>(); |
138 | 138 |
139 void passThrough(String argument) => options.add(argument); | 139 void passThrough(String argument) => options.add(argument); |
140 | 140 |
| 141 void ignoreOption(String argument) {} |
| 142 |
141 if (BUILD_ID != null) { | 143 if (BUILD_ID != null) { |
142 passThrough("--build-id=$BUILD_ID"); | 144 passThrough("--build-id=$BUILD_ID"); |
143 } | 145 } |
144 | 146 |
145 void setLibraryRoot(String argument) { | 147 void setLibraryRoot(String argument) { |
146 libraryRoot = currentDirectory.resolve(extractPath(argument)); | 148 libraryRoot = currentDirectory.resolve(extractPath(argument)); |
147 } | 149 } |
148 | 150 |
149 void setPackageRoot(String argument) { | 151 void setPackageRoot(String argument) { |
150 packageRoot = currentDirectory.resolve(extractPath(argument)); | 152 packageRoot = currentDirectory.resolve(extractPath(argument)); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 '--output-type=dart|--output-type=dart-multi|--output-type=js', | 327 '--output-type=dart|--output-type=dart-multi|--output-type=js', |
326 setOutputType), | 328 setOutputType), |
327 new OptionHandler(Flags.useKernel, passThrough), | 329 new OptionHandler(Flags.useKernel, passThrough), |
328 new OptionHandler(Flags.noFrequencyBasedMinification, passThrough), | 330 new OptionHandler(Flags.noFrequencyBasedMinification, passThrough), |
329 new OptionHandler(Flags.verbose, setVerbose), | 331 new OptionHandler(Flags.verbose, setVerbose), |
330 new OptionHandler(Flags.version, (_) => wantVersion = true), | 332 new OptionHandler(Flags.version, (_) => wantVersion = true), |
331 new OptionHandler('--library-root=.+', setLibraryRoot), | 333 new OptionHandler('--library-root=.+', setLibraryRoot), |
332 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), | 334 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), |
333 new OptionHandler(Flags.allowMockCompilation, passThrough), | 335 new OptionHandler(Flags.allowMockCompilation, passThrough), |
334 new OptionHandler(Flags.fastStartup, passThrough), | 336 new OptionHandler(Flags.fastStartup, passThrough), |
335 new OptionHandler(Flags.genericMethodSyntax, passThrough), | 337 new OptionHandler(Flags.genericMethodSyntax, ignoreOption), |
336 new OptionHandler(Flags.initializingFormalAccess, passThrough), | 338 new OptionHandler(Flags.initializingFormalAccess, passThrough), |
337 new OptionHandler('${Flags.minify}|-m', implyCompilation), | 339 new OptionHandler('${Flags.minify}|-m', implyCompilation), |
338 new OptionHandler(Flags.preserveUris, passThrough), | 340 new OptionHandler(Flags.preserveUris, passThrough), |
339 new OptionHandler('--force-strip=.*', setStrip), | 341 new OptionHandler('--force-strip=.*', setStrip), |
340 new OptionHandler(Flags.disableDiagnosticColors, (_) { | 342 new OptionHandler(Flags.disableDiagnosticColors, (_) { |
341 enableColors = false; | 343 enableColors = false; |
342 }), | 344 }), |
343 new OptionHandler(Flags.enableDiagnosticColors, (_) { | 345 new OptionHandler(Flags.enableDiagnosticColors, (_) { |
344 enableColors = true; | 346 enableColors = true; |
345 }), | 347 }), |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 @override | 1033 @override |
1032 void close() { | 1034 void close() { |
1033 // Do nothing. | 1035 // Do nothing. |
1034 } | 1036 } |
1035 | 1037 |
1036 @override | 1038 @override |
1037 void addError(errorEvent, [StackTrace stackTrace]) { | 1039 void addError(errorEvent, [StackTrace stackTrace]) { |
1038 // Ignore | 1040 // Ignore |
1039 } | 1041 } |
1040 } | 1042 } |
OLD | NEW |