OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:io'; | 5 import 'dart:io'; |
6 import 'package:analyzer/src/generated/source.dart' show Source; | 6 import 'package:analyzer/src/generated/source.dart' show Source; |
7 import 'package:analyzer/src/summary/package_bundle_reader.dart' | 7 import 'package:analyzer/src/summary/package_bundle_reader.dart' |
8 show InSummarySource; | 8 show InSummarySource; |
9 import 'package:args/args.dart' show ArgParser, ArgResults; | 9 import 'package:args/args.dart' show ArgParser, ArgResults; |
10 import 'package:args/command_runner.dart' show UsageException; | 10 import 'package:args/command_runner.dart' show UsageException; |
11 import 'package:path/path.dart' as path; | 11 import 'package:path/path.dart' as path; |
12 | 12 |
13 import '../analyzer/context.dart' show AnalyzerOptions; | 13 import '../analyzer/context.dart' show AnalyzerOptions; |
14 import 'compiler.dart' | 14 import 'compiler.dart' show BuildUnit, CompilerOptions, ModuleCompiler; |
15 show BuildUnit, CompilerOptions, JSModuleFile, ModuleCompiler; | |
16 import 'module_builder.dart'; | 15 import 'module_builder.dart'; |
17 | 16 |
18 final ArgParser _argParser = () { | 17 final ArgParser _argParser = () { |
19 var argParser = new ArgParser() | 18 var argParser = new ArgParser() |
20 ..addFlag('help', abbr: 'h', help: 'Display this message.') | 19 ..addFlag('help', abbr: 'h', help: 'Display this message.') |
21 ..addOption('out', | 20 ..addOption('out', |
22 abbr: 'o', allowMultiple: true, help: 'Output file (required).') | 21 abbr: 'o', allowMultiple: true, help: 'Output file (required).') |
23 ..addOption('module-root', | 22 ..addOption('module-root', |
24 help: 'Root module directory.\n' | 23 help: 'Root module directory.\n' |
25 'Generated module paths are relative to this root.') | 24 'Generated module paths are relative to this root.') |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 '\n\n${_argParser.usage}'; | 173 '\n\n${_argParser.usage}'; |
175 | 174 |
176 void _usageException(String message) { | 175 void _usageException(String message) { |
177 throw new UsageException(message, _usageMessage); | 176 throw new UsageException(message, _usageMessage); |
178 } | 177 } |
179 | 178 |
180 /// Thrown when the input source code has errors. | 179 /// Thrown when the input source code has errors. |
181 class CompileErrorException implements Exception { | 180 class CompileErrorException implements Exception { |
182 toString() => '\nPlease fix all errors before compiling (warnings are okay).'; | 181 toString() => '\nPlease fix all errors before compiling (warnings are okay).'; |
183 } | 182 } |
OLD | NEW |