Refactor daemon to check for project's supported platforms (#106704)
* Refactor daemon to check for project's supported platforms * Fix type issue
This commit is contained in:
@@ -413,25 +413,26 @@ class DaemonDomain extends Domain {
|
||||
final List<String> result = <String>[];
|
||||
try {
|
||||
final FlutterProject flutterProject = FlutterProject.fromDirectory(globals.fs.directory(projectRoot));
|
||||
if (featureFlags.isLinuxEnabled && flutterProject.linux.existsSync()) {
|
||||
final Set<SupportedPlatform> supportedPlatforms = flutterProject.getSupportedPlatforms().toSet();
|
||||
if (featureFlags.isLinuxEnabled && supportedPlatforms.contains(SupportedPlatform.linux)) {
|
||||
result.add('linux');
|
||||
}
|
||||
if (featureFlags.isMacOSEnabled && flutterProject.macos.existsSync()) {
|
||||
if (featureFlags.isMacOSEnabled && supportedPlatforms.contains(SupportedPlatform.macos)) {
|
||||
result.add('macos');
|
||||
}
|
||||
if (featureFlags.isWindowsEnabled && flutterProject.windows.existsSync()) {
|
||||
if (featureFlags.isWindowsEnabled && supportedPlatforms.contains(SupportedPlatform.windows)) {
|
||||
result.add('windows');
|
||||
}
|
||||
if (featureFlags.isIOSEnabled && flutterProject.ios.existsSync()) {
|
||||
if (featureFlags.isIOSEnabled && supportedPlatforms.contains(SupportedPlatform.ios)) {
|
||||
result.add('ios');
|
||||
}
|
||||
if (featureFlags.isAndroidEnabled && flutterProject.android.existsSync()) {
|
||||
if (featureFlags.isAndroidEnabled && supportedPlatforms.contains(SupportedPlatform.android)) {
|
||||
result.add('android');
|
||||
}
|
||||
if (featureFlags.isWebEnabled && flutterProject.web.existsSync()) {
|
||||
if (featureFlags.isWebEnabled && supportedPlatforms.contains(SupportedPlatform.web)) {
|
||||
result.add('web');
|
||||
}
|
||||
if (featureFlags.isFuchsiaEnabled && flutterProject.fuchsia.existsSync()) {
|
||||
if (featureFlags.isFuchsiaEnabled && supportedPlatforms.contains(SupportedPlatform.fuchsia)) {
|
||||
result.add('fuchsia');
|
||||
}
|
||||
if (featureFlags.areCustomDevicesEnabled) {
|
||||
|
||||
Reference in New Issue
Block a user