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

Unified Diff: pkg/compiler/lib/src/dart2js.dart

Issue 2004833003: Support multiple resolution inputs from command line. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix after rebase Created 4 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart2js.dart
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 5dffdf7dee09a0d11dbb8c9c5c441549ef74e87b..64bb70a474b0eacf05fa0c8f4adc0a970a786c4e 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -108,7 +108,7 @@ Future<api.CompilationResult> compile(List<String> argv) {
Uri libraryRoot = currentDirectory;
Uri out = currentDirectory.resolve('out.js');
Uri sourceMapOut = currentDirectory.resolve('out.js.map');
- Uri resolutionInput;
+ List<Uri> resolutionInputs;
Uri packageConfig = null;
Uri packageRoot = null;
List<String> options = new List<String>();
@@ -190,8 +190,11 @@ Future<api.CompilationResult> compile(List<String> argv) {
}
void setResolutionInput(String argument) {
- resolutionInput =
- currentDirectory.resolve(extractPath(argument, isDirectory: false));
+ resolutionInputs = <Uri>[];
+ String parts = extractParameter(argument);
+ for (String part in parts.split(',')) {
+ resolutionInputs.add(currentDirectory.resolve(nativeToUriPath(part)));
+ }
}
void setResolveOnly(String argument) {
@@ -525,7 +528,7 @@ Future<api.CompilationResult> compile(List<String> argv) {
packageRoot: packageRoot,
packageConfig: packageConfig,
packagesDiscoveryProvider: findPackages,
- resolutionInput: resolutionInput,
+ resolutionInputs: resolutionInputs,
resolutionOutput: resolutionOutput,
options: options,
environment: environment);
@@ -834,6 +837,9 @@ void batchMain(List<String> batchArguments) {
final bool USE_SERIALIZED_DART_CORE =
Platform.environment['USE_SERIALIZED_DART_CORE'] == 'true';
+/// Mock URI used only in testing when [USE_SERIALIZED_DART_CORE] is enabled.
+final Uri _SERIALIZED_URI = Uri.parse('file:fake.data');
+
void _useSerializedDataForDartCore(CompileFunc oldCompileFunc) {
String serializedData;
@@ -844,7 +850,7 @@ void _useSerializedDataForDartCore(CompileFunc oldCompileFunc) {
api.CompilerOutput compilerOutput) async {
CompilerImpl compiler = new CompilerImpl(
compilerInput, compilerOutput, compilerDiagnostics, compilerOptions);
- compiler.serialization.deserializeFromText(serializedData);
+ compiler.serialization.deserializeFromText(_SERIALIZED_URI, serializedData);
return compiler.run(compilerOptions.entryPoint).then((bool success) {
return new api.CompilationResult(compiler, isSuccess: success);
});
@@ -865,7 +871,7 @@ void _useSerializedDataForDartCore(CompileFunc oldCompileFunc) {
packagesDiscoveryProvider:
compilerOptions.packagesDiscoveryProvider,
environment: compilerOptions.environment,
- resolutionOutput: Uri.parse('file:fake.data'),
+ resolutionOutput: _SERIALIZED_URI,
options: [Flags.resolveOnly]),
compilerInput,
compilerDiagnostics,
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698