From b9274c7c607bdb287d3b0483c5a3a8dcf5b35fcb Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 24 Sep 2020 12:51:18 -0700 Subject: [PATCH] [flutter_tools] bypass pubspec yaml content check when running pubdependencies (#66559) Otherwise the heuristics we have may decide to skip running pub. We should consider reducing the number of dimensions of caching here to a single check optimized for the run/test case. --- packages/flutter_tools/lib/src/cache.dart | 4 +++- packages/flutter_tools/test/general.shard/cache_test.dart | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index bc273b7dc93..aaca036d789 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -647,7 +647,7 @@ class PubDependencies extends ArtifactSet { logger: _logger, throwOnError: false, ); - if (packageConfig == null || packageConfig == PackageConfig.empty ) { + if (packageConfig == null || packageConfig == PackageConfig.empty) { return false; } for (final Package package in packageConfig.packages) { @@ -667,6 +667,8 @@ class PubDependencies extends ArtifactSet { context: PubContext.pubGet, directory: _fileSystem.path.join(_flutterRoot(), 'packages', 'flutter_tools'), generateSyntheticPackage: false, + skipPubspecYamlCheck: true, + checkLastModified: false, ); } } diff --git a/packages/flutter_tools/test/general.shard/cache_test.dart b/packages/flutter_tools/test/general.shard/cache_test.dart index 94863e199e0..920b00ddcb6 100644 --- a/packages/flutter_tools/test/general.shard/cache_test.dart +++ b/packages/flutter_tools/test/general.shard/cache_test.dart @@ -744,6 +744,8 @@ void main() { context: PubContext.pubGet, directory: 'packages/flutter_tools', generateSyntheticPackage: false, + skipPubspecYamlCheck: true, + checkLastModified: false, )).called(1); }); }