[flutter_tools] daemon does not report platforms that are not enabled (#73736)
This commit is contained in:
@@ -19,6 +19,7 @@ import '../build_info.dart';
|
||||
import '../convert.dart';
|
||||
import '../device.dart';
|
||||
import '../emulator.dart';
|
||||
import '../features.dart';
|
||||
import '../globals.dart' as globals;
|
||||
import '../project.dart';
|
||||
import '../resident_runner.dart';
|
||||
@@ -365,28 +366,26 @@ class DaemonDomain extends Domain {
|
||||
final String projectRoot = _getStringArg(args, 'projectRoot', required: true);
|
||||
final List<String> result = <String>[];
|
||||
try {
|
||||
// TODO(jonahwilliams): replace this with a project metadata check once
|
||||
// that has been implemented.
|
||||
final FlutterProject flutterProject = FlutterProject.fromDirectory(globals.fs.directory(projectRoot));
|
||||
if (flutterProject.linux.existsSync()) {
|
||||
if (featureFlags.isLinuxEnabled && flutterProject.linux.existsSync()) {
|
||||
result.add('linux');
|
||||
}
|
||||
if (flutterProject.macos.existsSync()) {
|
||||
if (featureFlags.isMacOSEnabled && flutterProject.macos.existsSync()) {
|
||||
result.add('macos');
|
||||
}
|
||||
if (flutterProject.windows.existsSync()) {
|
||||
if (featureFlags.isWindowsEnabled && flutterProject.windows.existsSync()) {
|
||||
result.add('windows');
|
||||
}
|
||||
if (flutterProject.ios.existsSync()) {
|
||||
if (featureFlags.isIOSEnabled && flutterProject.ios.existsSync()) {
|
||||
result.add('ios');
|
||||
}
|
||||
if (flutterProject.android.existsSync()) {
|
||||
if (featureFlags.isAndroidEnabled && flutterProject.android.existsSync()) {
|
||||
result.add('android');
|
||||
}
|
||||
if (flutterProject.web.existsSync()) {
|
||||
if (featureFlags.isWebEnabled && flutterProject.web.existsSync()) {
|
||||
result.add('web');
|
||||
}
|
||||
if (flutterProject.fuchsia.existsSync()) {
|
||||
if (featureFlags.isFuchsiaEnabled && flutterProject.fuchsia.existsSync()) {
|
||||
result.add('fuchsia');
|
||||
}
|
||||
return <String, Object>{
|
||||
|
||||
Reference in New Issue
Block a user