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

Unified Diff: pkg/front_end/lib/src/fasta/compiler_command_line.dart

Issue 2832353002: Add support for building patched_sdk and platform.dill for dart2js: (Closed)
Patch Set: rebase Created 3 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: pkg/front_end/lib/src/fasta/compiler_command_line.dart
diff --git a/pkg/front_end/lib/src/fasta/compiler_command_line.dart b/pkg/front_end/lib/src/fasta/compiler_command_line.dart
index 7788309d1c0e1e6e13308944709b0e9f35187375..b02947b01d2e6acd3899fb217a820aefbff014d6 100644
--- a/pkg/front_end/lib/src/fasta/compiler_command_line.dart
+++ b/pkg/front_end/lib/src/fasta/compiler_command_line.dart
@@ -16,6 +16,7 @@ const Map<String, dynamic> optionSpecification = const <String, dynamic>{
"--output": Uri,
"--packages": Uri,
"--platform": Uri,
+ "--target": String,
"-o": Uri,
};
@@ -55,6 +56,9 @@ class CompilerCommandLine extends CommandLine {
} else if (arguments.isEmpty) {
return argumentError(usage, "No Dart file specified.");
}
+ if (!targetDart2js && !targetVm) {
+ return argumentError(usage, "Invalid target");
ahe 2017/04/27 13:34:34 "Unknown target: '${options["--target"]}'."
Siggi Cherem (dart-lang) 2017/04/28 21:37:20 n/a anymore (flag is gone)
+ }
}
Uri get output {
@@ -73,6 +77,9 @@ class CompilerCommandLine extends CommandLine {
Uri get sdk => options["--compile-sdk"];
+ bool get targetDart2js => options["--target"] == 'dart2js';
+ bool get targetVm => (options["--target"] ?? 'vm') == 'vm';
+
Set<String> get fatal {
return new Set<String>.from(options["--fatal"] ?? <String>[]);
}
@@ -177,6 +184,12 @@ Supported options:
--compile-sdk=<patched_sdk>
Compile the SDK from scratch instead of reading it from 'platform.dill'.
+ --target=vm
+ --target=dart2js
+ Compile with the intention to pass the output to the given target. This will
+ affect which patch files are used for compiling the SDK and what
+ transformations will be done in the Kernel representation.
+
--fatal=errors
--fatal=warnings
--fatal=nits

Powered by Google App Engine
This is Rietveld 408576698