[flutter_tools] fix package config invalidation (#55420)

This commit is contained in:
Jonah Williams
2020-04-23 11:34:01 -07:00
committed by GitHub
parent 240611b05e
commit bb683c4cdb
2 changed files with 55 additions and 0 deletions

View File

@@ -1270,6 +1270,17 @@ class ProjectFileInvalidator {
if (updatedAt != null && updatedAt.isAfter(lastCompiled)) {
invalidatedFiles.add(packageUri);
packageConfig = await _createPackageConfig(packagesPath);
// The frontend_server might be monitoring the package_config.json file,
// Pub should always produce both files.
// TODO(jonahwilliams): remove after https://github.com/flutter/flutter/issues/55249
if (_fileSystem.path.basename(packagesPath) == '.packages') {
final File packageConfigFile = _fileSystem.file(packagesPath)
.parent.childDirectory('.dart_tool')
.childFile('package_config.json');
if (packageConfigFile.existsSync()) {
invalidatedFiles.add(packageConfigFile.uri);
}
}
}
_logger.printTrace(