Don't pre-cache Android artifacts with --no-android flag (#49009)

This commit is contained in:
Jenn Magder
2020-01-20 23:23:02 -08:00
committed by Flutter GitHub Bot
parent 975bb08a62
commit ac7b307803
2 changed files with 58 additions and 8 deletions

View File

@@ -44,8 +44,6 @@ void main() {
expect(artifacts, unorderedEquals(<DevelopmentArtifact>{
DevelopmentArtifact.universal,
DevelopmentArtifact.web,
DevelopmentArtifact.androidGenSnapshot,
DevelopmentArtifact.androidMaven,
}));
}, overrides: <Type, Generator>{
Cache: () => cache,
@@ -59,14 +57,25 @@ void main() {
expect(artifacts, unorderedEquals(<DevelopmentArtifact>{
DevelopmentArtifact.universal,
DevelopmentArtifact.androidGenSnapshot,
DevelopmentArtifact.androidMaven,
}));
}, overrides: <Type, Generator>{
Cache: () => cache,
FeatureFlags: () => TestFeatureFlags(isWebEnabled: false),
});
testUsingContext('precache exits if requesting mismatched artifacts.', () async {
final PrecacheCommand command = PrecacheCommand();
applyMocksToCommand(command);
expect(createTestCommandRunner(command).run(const <String>['precache',
'--no-android',
'--android_gen_snapshot',
]), throwsToolExit(message: '--android_gen_snapshot requires --android'));
}, overrides: <Type, Generator>{
Cache: () => cache,
FeatureFlags: () => TestFeatureFlags(isWebEnabled: false),
});
testUsingContext('precache adds artifact flags to requested artifacts', () async {
final PrecacheCommand command = PrecacheCommand();
applyMocksToCommand(command);