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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_target.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 | « pkg/front_end/lib/src/fasta/fasta.dart ('k') | pkg/front_end/lib/src/fasta/vm.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/kernel/kernel_target.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index b503d0fb4b2fa83c34fd8ad36dde1ee774086223..896fd3db126a077ef741008f53ea7960dd53b831 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -271,18 +271,29 @@ class KernelTarget extends TargetImplementation {
}
}
- Future writeDepsFile(Uri output, Uri depsFile) async {
+ Future writeDepsFile(Uri output, Uri depsFile,
+ {Iterable<Uri> extraDependencies}) async {
+ Uri base = depsFile.resolve(".");
+ String toRelativeFilePath(Uri uri) {
+ return Uri.parse(relativizeUri(uri, base: base)).toFilePath();
+ }
+
if (loader.first == null) return null;
StringBuffer sb = new StringBuffer();
- Uri base = depsFile.resolve(".");
- sb.write(Uri.parse(relativizeUri(output, base: base)).toFilePath());
+ sb.write(toRelativeFilePath(output));
sb.write(":");
- for (Uri dependency in loader.getDependencies()) {
+ Set<String> allDependencies = new Set<String>();
+ allDependencies.addAll(loader.getDependencies().map(toRelativeFilePath));
+ if (extraDependencies != null) {
+ allDependencies.addAll(extraDependencies.map(toRelativeFilePath));
+ }
+ for (String path in allDependencies) {
sb.write(" ");
- sb.write(Uri.parse(relativizeUri(dependency, base: base)).toFilePath());
+ sb.write(path);
}
sb.writeln();
await new File.fromUri(depsFile).writeAsString("$sb");
+ ticker.logMs("Wrote deps file");
}
Program erroneousProgram(bool isFullProgram) {
« no previous file with comments | « pkg/front_end/lib/src/fasta/fasta.dart ('k') | pkg/front_end/lib/src/fasta/vm.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698