ensure lastBuildTimestamp is set before early return (#25058)

This commit is contained in:
Jonah Williams
2018-12-10 15:57:52 -08:00
committed by GitHub
parent 243222c00d
commit 61291aeeaf
4 changed files with 24 additions and 2 deletions

View File

@@ -107,6 +107,10 @@ class _ManifestAssetBundle implements AssetBundle {
if (flutterManifest == null)
return 1;
// If the last build time isn't set before this early return, empty pubspecs will
// hang on hot reload, as the incremental dill files will never be copied to the
// device.
_lastBuildTimestamp = DateTime.now();
if (flutterManifest.isEmpty) {
entries[_assetManifestJson] = DevFSStringContent('{}');
return 0;
@@ -114,8 +118,6 @@ class _ManifestAssetBundle implements AssetBundle {
final String assetBasePath = fs.path.dirname(fs.path.absolute(manifestPath));
_lastBuildTimestamp = DateTime.now();
final PackageMap packageMap = PackageMap(packagesPath);
// The _assetVariants map contains an entry for each asset listed