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

Unified Diff: lib/src/compiler/command.dart

Issue 1917863005: Qualify library names in packages (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 4 years, 8 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
Index: lib/src/compiler/command.dart
diff --git a/lib/src/compiler/command.dart b/lib/src/compiler/command.dart
index 6cb95da11657320bd2d0a2beddf127ab9143696a..29264fbb82bf8baa78130b9b6964f75c20fa68e9 100644
--- a/lib/src/compiler/command.dart
+++ b/lib/src/compiler/command.dart
@@ -24,6 +24,10 @@ class CompileCommand extends Command {
CompileCommand({MessageHandler messageHandler})
: this.messageHandler = messageHandler ?? print {
argParser.addOption('out', abbr: 'o', help: 'Output file (required)');
+ argParser.addOption('build-root',
+ help: '''
+Root of source files. Generated library names are relative to this root.
+''');
CompilerOptions.addArguments(argParser);
AnalyzerOptions.addArguments(argParser);
}
@@ -39,7 +43,14 @@ class CompileCommand extends Command {
usageException('Please include the output file location. For example:\n'
' -o PATH/TO/OUTPUT_FILE.js');
}
- var unit = new BuildUnit(path.basenameWithoutExtension(outPath),
+
+ var buildRoot = argResults['build-root'] as String;
+ if (buildRoot != null) {
+ buildRoot = path.absolute(buildRoot);
+ } else {
+ buildRoot = Directory.current.path;
+ }
+ var unit = new BuildUnit(path.basenameWithoutExtension(outPath), buildRoot,
argResults.rest, _moduleForLibrary);
JSModuleFile module = compiler.compile(unit, compilerOptions);

Powered by Google App Engine
This is Rietveld 408576698