| Index: pkg/dev_compiler/lib/src/compiler/command.dart
|
| diff --git a/pkg/dev_compiler/lib/src/compiler/command.dart b/pkg/dev_compiler/lib/src/compiler/command.dart
|
| index 102f33a6610717e809131d6372c6311585e19f5e..58f6d707b7ec893a6405fca6f8bcb1deefe083b1 100644
|
| --- a/pkg/dev_compiler/lib/src/compiler/command.dart
|
| +++ b/pkg/dev_compiler/lib/src/compiler/command.dart
|
| @@ -32,7 +32,7 @@ int compile(List<String> args, {void printFn(Object obj)}) {
|
| ArgResults argResults;
|
| AnalyzerOptions analyzerOptions;
|
| try {
|
| - var parser = _argParser();
|
| + var parser = ddcArgParser();
|
| if (args.contains('--$ignoreUnrecognizedFlagsFlag')) {
|
| args = filterUnknownArguments(args, parser);
|
| }
|
| @@ -83,7 +83,7 @@ $stackTrace
|
| }
|
| }
|
|
|
| -ArgParser _argParser({bool hide: true}) {
|
| +ArgParser ddcArgParser({bool hide: true}) {
|
| var argParser = new ArgParser(allowTrailingOptions: true)
|
| ..addFlag('help',
|
| abbr: 'h',
|
| @@ -121,7 +121,14 @@ bool _changed(List<int> list1, List<int> list2) {
|
|
|
| void _compile(ArgResults argResults, AnalyzerOptions analyzerOptions,
|
| void printFn(Object obj)) {
|
| - var compiler = new ModuleCompiler(analyzerOptions);
|
| + var libraryRoot = argResults['library-root'] as String;
|
| + if (libraryRoot != null) {
|
| + libraryRoot = path.absolute(libraryRoot);
|
| + } else {
|
| + libraryRoot = Directory.current.path;
|
| + }
|
| +
|
| + var compiler = new ModuleCompiler(libraryRoot, analyzerOptions);
|
| var compilerOpts = new CompilerOptions.fromArguments(argResults);
|
| var outPaths = argResults['out'] as List<String>;
|
| var moduleFormats = parseModuleFormatOption(argResults);
|
| @@ -147,12 +154,6 @@ void _compile(ArgResults argResults, AnalyzerOptions analyzerOptions,
|
| // we've removed the "root" and "module name" variables.
|
| var firstOutPath = outPaths[0];
|
|
|
| - var libraryRoot = argResults['library-root'] as String;
|
| - if (libraryRoot != null) {
|
| - libraryRoot = path.absolute(libraryRoot);
|
| - } else {
|
| - libraryRoot = Directory.current.path;
|
| - }
|
| var moduleRoot = argResults['module-root'] as String;
|
| String modulePath;
|
| if (moduleRoot != null) {
|
| @@ -225,7 +226,7 @@ String _moduleForLibrary(
|
|
|
| String get _usageMessage =>
|
| 'Dart Development Compiler compiles Dart into a JavaScript module.'
|
| - '\n\n${_argParser(hide: !_verbose).usage}';
|
| + '\n\n${ddcArgParser(hide: !_verbose).usage}';
|
|
|
| void _usageException(String message) {
|
| throw new UsageException(message, _usageMessage);
|
|
|