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

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

Issue 2742333006: Move patch file generation to fasta. (Closed)
Patch Set: Extract method. Created 3 years, 9 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 | « no previous file | pkg/front_end/lib/src/fasta/fasta.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/compile_platform.dart
diff --git a/pkg/front_end/lib/src/fasta/compile_platform.dart b/pkg/front_end/lib/src/fasta/compile_platform.dart
index 5b92567a9b0a4a9c90c7d6637bd7705b2040417f..61af60b05db376cbe428a71d296e2f80a670c60d 100644
--- a/pkg/front_end/lib/src/fasta/compile_platform.dart
+++ b/pkg/front_end/lib/src/fasta/compile_platform.dart
@@ -29,10 +29,8 @@ Future mainEntryPoint(List<String> arguments) async {
if (i > 0) {
print("\n");
}
- Ticker ticker = new Ticker();
try {
- await CompilerCommandLine.withGlobalOptions("compile_platform", arguments,
- (CompilerContext c) => compilePlatform(c, ticker));
+ await compilePlatform(arguments);
} on InputError catch (e) {
exitCode = 1;
print(e.format());
@@ -41,11 +39,20 @@ Future mainEntryPoint(List<String> arguments) async {
}
}
-Future compilePlatform(CompilerContext c, Ticker ticker) async {
+Future compilePlatform(List<String> arguments) async {
+ Ticker ticker = new Ticker();
+ await CompilerCommandLine.withGlobalOptions("compile_platform", arguments,
+ (CompilerContext c) {
+ Uri patchedSdk = Uri.base.resolveUri(new Uri.file(c.options.arguments[0]));
+ Uri output = Uri.base.resolveUri(new Uri.file(c.options.arguments[1]));
+ return compilePlatformInternal(c, ticker, patchedSdk, output);
+ });
+}
+
+Future compilePlatformInternal(
+ CompilerContext c, Ticker ticker, Uri patchedSdk, Uri output) async {
ticker.isVerbose = c.options.verbose;
- Uri output = Uri.base.resolveUri(new Uri.file(c.options.arguments[1]));
- Uri deps = Uri.base.resolveUri(new Uri.file("${c.options.arguments[1]}.d"));
- Uri patchedSdk = Uri.base.resolveUri(new Uri.file(c.options.arguments[0]));
+ Uri deps = Uri.base.resolveUri(new Uri.file("${output.toFilePath()}.d"));
ticker.logMs("Parsed arguments");
if (ticker.isVerbose) {
print("Compiling $patchedSdk to $output");
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/fasta.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698