[flutter_tools] no-op maven artifacts if Android SDK is absent (#73957)

This commit is contained in:
Jonah Williams
2021-01-14 12:09:06 -08:00
committed by GitHub
parent f1718bcf06
commit bf4a5484aa
2 changed files with 34 additions and 16 deletions

View File

@@ -1136,6 +1136,8 @@ class AndroidGenSnapshotArtifacts extends EngineCachedArtifact {
}
/// A cached artifact containing the Maven dependencies used to build Android projects.
///
/// This is a no-op if the android SDK is not available.
class AndroidMavenArtifacts extends ArtifactSet {
AndroidMavenArtifacts(this.cache, {
@required Platform platform,
@@ -1152,6 +1154,9 @@ class AndroidMavenArtifacts extends ArtifactSet {
FileSystem fileSystem,
OperatingSystemUtils operatingSystemUtils,
) async {
if (globals.androidSdk == null) {
return;
}
final Directory tempDir = cache.getRoot().createTempSync(
'flutter_gradle_wrapper.',
);