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

Unified Diff: lib/src/compiler.dart

Issue 1327573002: make build_sdk more incremental (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 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 | tool/build_sdk.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler.dart
diff --git a/lib/src/compiler.dart b/lib/src/compiler.dart
index 1723d4c5fb58fb83a8a694452cf0c64c0b5c666c..f5a0aecf82f7936cfba2fab49069c0eab25b1b64 100644
--- a/lib/src/compiler.dart
+++ b/lib/src/compiler.dart
@@ -173,6 +173,20 @@ class BatchCompiler extends AbstractCompiler {
}
if (_jsGen != null) {
+ // TODO(jmesserly): full incremental support would avoid checking as well,
Jennifer Messerly 2015/08/31 23:43:08 I'm already making good progress on addressing thi
+ // however, we'd lose compiler messages in that case.
+
+ // Note: analyzer's modification stamp is millisecondsSinceEpoch
+ int lastModifyTime = unitElements
+ .map((e) => context.getModificationStamp(e.source))
+ .reduce(math.max);
+ var outFile = new File(getOutputPath(library.source.uri));
+ if (outFile.existsSync() &&
+ outFile.lastModifiedSync().millisecondsSinceEpoch >= lastModifyTime) {
+ // Output already up to date.
+ return;
+ }
+
var unit = units.first;
var parts = units.skip(1).toList();
_jsGen.generateLibrary(new LibraryUnit(unit, parts));
« no previous file with comments | « no previous file | tool/build_sdk.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698