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)); |