Unverified Commit 6a22f412 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

add desktop artifacts to run/target_platform selectors (#31505)

parent ca0e7789
...@@ -621,26 +621,9 @@ mixin DeviceBasedDevelopmentArtifacts on FlutterCommand { ...@@ -621,26 +621,9 @@ mixin DeviceBasedDevelopmentArtifacts on FlutterCommand {
}; };
for (Device device in devices) { for (Device device in devices) {
final TargetPlatform targetPlatform = await device.targetPlatform; final TargetPlatform targetPlatform = await device.targetPlatform;
switch (targetPlatform) { final DevelopmentArtifact developmentArtifact = _artifactFromTargetPlatform(targetPlatform);
case TargetPlatform.android_arm: if (developmentArtifact != null) {
case TargetPlatform.android_arm64: artifacts.add(developmentArtifact);
case TargetPlatform.android_x64:
case TargetPlatform.android_x86:
artifacts.add(DevelopmentArtifact.android);
break;
case TargetPlatform.web:
artifacts.add(DevelopmentArtifact.web);
break;
case TargetPlatform.ios:
artifacts.add(DevelopmentArtifact.iOS);
break;
case TargetPlatform.darwin_x64:
case TargetPlatform.fuchsia:
case TargetPlatform.tester:
case TargetPlatform.windows_x64:
case TargetPlatform.linux_x64:
// No artifacts currently supported.
break;
} }
} }
return artifacts; return artifacts;
...@@ -663,29 +646,48 @@ mixin TargetPlatformBasedDevelopmentArtifacts on FlutterCommand { ...@@ -663,29 +646,48 @@ mixin TargetPlatformBasedDevelopmentArtifacts on FlutterCommand {
final Set<DevelopmentArtifact> artifacts = <DevelopmentArtifact>{ final Set<DevelopmentArtifact> artifacts = <DevelopmentArtifact>{
DevelopmentArtifact.universal, DevelopmentArtifact.universal,
}; };
final DevelopmentArtifact developmentArtifact = _artifactFromTargetPlatform(targetPlatform);
if (developmentArtifact != null) {
artifacts.add(developmentArtifact);
}
return artifacts;
}
}
// Returns the development artifact for the target platform, or null
// if none is supported
DevelopmentArtifact _artifactFromTargetPlatform(TargetPlatform targetPlatform) {
switch (targetPlatform) { switch (targetPlatform) {
case TargetPlatform.android_arm: case TargetPlatform.android_arm:
case TargetPlatform.android_arm64: case TargetPlatform.android_arm64:
case TargetPlatform.android_x64: case TargetPlatform.android_x64:
case TargetPlatform.android_x86: case TargetPlatform.android_x86:
artifacts.add(DevelopmentArtifact.android); return DevelopmentArtifact.android;
break;
case TargetPlatform.web: case TargetPlatform.web:
artifacts.add(DevelopmentArtifact.web); return DevelopmentArtifact.web;
break;
case TargetPlatform.ios: case TargetPlatform.ios:
artifacts.add(DevelopmentArtifact.iOS); return DevelopmentArtifact.iOS;
break;
case TargetPlatform.darwin_x64: case TargetPlatform.darwin_x64:
case TargetPlatform.fuchsia: if (!FlutterVersion.instance.isStable) {
case TargetPlatform.tester: return DevelopmentArtifact.macOS;
}
return null;
case TargetPlatform.windows_x64: case TargetPlatform.windows_x64:
if (!FlutterVersion.instance.isStable) {
return DevelopmentArtifact.windows;
}
return null;
case TargetPlatform.linux_x64: case TargetPlatform.linux_x64:
// No artifacts currently supported. if (!FlutterVersion.instance.isStable) {
break; return DevelopmentArtifact.linux;
} }
return artifacts; return null;
case TargetPlatform.fuchsia:
case TargetPlatform.tester:
// No artifacts currently supported.
return null;
} }
return null;
} }
/// A command which runs less analytics and checks to speed up startup time. /// A command which runs less analytics and checks to speed up startup time.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment