Allow filtering devices to only those supported by current project (#31446)
diff --git a/packages/flutter_tools/lib/src/project.dart b/packages/flutter_tools/lib/src/project.dart index 641c281..2f132de 100644 --- a/packages/flutter_tools/lib/src/project.dart +++ b/packages/flutter_tools/lib/src/project.dart
@@ -208,8 +208,6 @@ Directory get _ephemeralDirectory => parent.directory.childDirectory('.ios'); Directory get _editableDirectory => parent.directory.childDirectory('ios'); - bool existsSync() => parent.isModule || _editableDirectory.existsSync(); - /// This parent folder of `Runner.xcodeproj`. Directory get hostAppRoot { if (!isModule || _editableDirectory.existsSync()) @@ -264,6 +262,11 @@ /// Xcode workspace shared workspace settings file for the host app. File get xcodeWorkspaceSharedSettings => xcodeWorkspaceSharedData.childFile('WorkspaceSettings.xcsettings'); + /// Whether the current flutter project has an iOS subproject. + bool existsSync() { + return parent.isModule || _editableDirectory.existsSync(); + } + /// The product bundle identifier of the host app, or null if not set or if /// iOS tooling needed to read it is not installed. String get productBundleIdentifier { @@ -391,8 +394,6 @@ return _ephemeralDirectory; } - bool existsSync() => parent.isModule || _flutterLibGradleRoot.existsSync(); - /// The Gradle root directory of the Android wrapping of Flutter and plugins. /// This is the same as [hostAppGradleRoot] except when the project is /// a Flutter module with an editable host app. @@ -420,6 +421,11 @@ return fs.directory(fs.path.join(hostAppGradleRoot.path, 'app', 'build', 'outputs', 'bundle')); } + /// Whether the current flutter project has an Android sub-project. + bool existsSync() { + return parent.isModule || _editableHostAppDirectory.existsSync(); + } + bool get isUsingGradle { return hostAppGradleRoot.childFile('build.gradle').existsSync(); } @@ -498,7 +504,10 @@ final FlutterProject parent; - bool existsSync() => parent.directory.childDirectory('web').existsSync(); + /// Whether this flutter project has a web sub-project. + bool existsSync() { + return parent.directory.childDirectory('web').existsSync(); + } Future<void> ensureReadyForPlatformSpecificTooling() async { /// Generate index.html in build/web. Eventually we could support @@ -590,4 +599,4 @@ /// The Linux project makefile. File get makeFile => editableHostAppDirectory.childFile('Makefile'); -} \ No newline at end of file +}