Index: tool/global_compile.dart |
diff --git a/tool/global_compile.dart b/tool/global_compile.dart |
index 673660a1671cb9a7b4ff66c826b6f8454577a39d..ebe504f54c4077ff9264fa67cafbda7e8fc23f8d 100644 |
--- a/tool/global_compile.dart |
+++ b/tool/global_compile.dart |
@@ -28,10 +28,15 @@ void main(List<String> args) { |
defaultsTo: 'out.js') |
..addFlag('unsafe-force-compile', |
help: 'Generate code with undefined behavior', negatable: false) |
+ ..addOption('packages', |
+ help: |
+ 'Path to the package resolution configuration file, which supplies ' |
+ 'a mapping of package names to paths. This option cannot be ' |
+ 'used with --package-root.') |
..addOption('package-root', |
- help: 'Directory containing packages', |
abbr: 'p', |
- defaultsTo: 'packages/') |
+ help: 'Path to a package root directory (deprecated). This option ' |
+ 'cannot be used with --packages.') |
..addFlag('log', help: 'Show individual build commands') |
..addOption('tmp', |
help: |
@@ -43,6 +48,7 @@ void main(List<String> args) { |
} |
var entry = options.rest.first; |
var outfile = options['out'] as String; |
+ var packages = options['packages'] as String; |
var packageRoot = options['package-root'] as String; |
var unsafe = options['unsafe-force-compile'] as bool; |
var log = options['log'] as bool; |
@@ -55,9 +61,13 @@ void main(List<String> args) { |
'$ddcPath/bin/dartdevc.dart', |
'compile', |
'--no-source-map', // Invalid as we're just concatenating files below |
- '-p', |
- packageRoot |
]; |
+ if (packages != null) { |
+ template.addAll(['--packages', packages]); |
+ } |
+ if (packageRoot != null) { |
+ template.addAll(['--package-root', packageRoot]); |
+ } |
if (unsafe) { |
template.add('--unsafe-force-compile'); |
} |