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

Unified Diff: lib/src/compiler.dart

Issue 1321103002: makes tests faster, see #304 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: stabalize messages 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 | lib/src/report.dart » ('j') | lib/src/report.dart » ('J')
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 91e97c88eacbc34c1b3e950572f83af21b4fdd37..1723d4c5fb58fb83a8a694452cf0c64c0b5c666c 100644
--- a/lib/src/compiler.dart
+++ b/lib/src/compiler.dart
@@ -78,6 +78,7 @@ class BatchCompiler extends AbstractCompiler {
/// Already compiled sources, so we don't compile them again.
final _compiled = new HashSet<LibraryElement>();
+ bool _sdkCopied = false;
bool _failure = false;
bool get failure => _failure;
@@ -101,6 +102,7 @@ class BatchCompiler extends AbstractCompiler {
void reset() {
_compiled.clear();
+ _sdkCopied = false;
}
/// Compiles every file in [options.inputs].
@@ -178,11 +180,17 @@ class BatchCompiler extends AbstractCompiler {
}
void _copyDartRuntime() {
+ if (_sdkCopied) return;
+ _sdkCopied = true;
for (var file in defaultRuntimeFiles) {
- var input = path.join(options.runtimeDir, file);
- var output = path.join(_runtimeOutputDir, file);
- new Directory(path.dirname(output)).createSync(recursive: true);
- new File(input).copySync(output);
+ var input = new File(path.join(options.runtimeDir, file));
+ var output = new File(path.join(_runtimeOutputDir, file));
+ if (output.existsSync() &&
+ output.lastModifiedSync() == input.lastModifiedSync()) {
+ continue;
+ }
+ new Directory(path.dirname(output.path)).createSync(recursive: true);
+ input.copySync(output.path);
}
}
« no previous file with comments | « no previous file | lib/src/report.dart » ('j') | lib/src/report.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698