Reland: don't update last compile time when compilation is rejected. (#41580)

* dont update last compiled time when compilation is rejected

* lets try flushing, thats a neat trick

* windows man

* Update hot_reload_test.dart

* Update hot_reload_test.dart

* Update devfs.dart

* Update hot_reload_test.dart

* Update hot_reload_test.dart

* add test that verifies when compile is good that time is updated

* Update devfs_test.dart
This commit is contained in:
Jonah Williams
2019-10-02 12:46:33 -07:00
committed by GitHub
parent 4512a1c1b7
commit 39f85f94ec
3 changed files with 43 additions and 4 deletions

View File

@@ -445,6 +445,7 @@ class DevFS {
}) async {
assert(trackWidgetCreation != null);
assert(generator != null);
final DateTime candidateCompileTime = DateTime.now();
// Update modified files
final String assetBuildDirPrefix = _asUriPath(getAssetBuildDirectory());
@@ -476,7 +477,6 @@ class DevFS {
generator.reset();
}
printTrace('Compiling dart to kernel with ${invalidatedFiles.length} updated files');
lastCompiled = DateTime.now();
final CompilerOutput compilerOutput = await generator.recompile(
mainPath,
invalidatedFiles,
@@ -486,6 +486,8 @@ class DevFS {
if (compilerOutput == null || compilerOutput.errorCount > 0) {
return UpdateFSReport(success: false);
}
// Only update the last compiled time if we successfully compiled.
lastCompiled = candidateCompileTime;
// list of sources that needs to be monitored are in [compilerOutput.sources]
sources = compilerOutput.sources;
//