Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tool/global_compile.dart

Issue 2188033002: fix #607, add support for package config file Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: remove obsolete todo Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/src/analyzer/context.dart ('K') | « test/worker/worker_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
}
« lib/src/analyzer/context.dart ('K') | « test/worker/worker_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698