Conversation
Reuse PlatformDirectoryDoesNotExistException for the missing platform directory case instead of a bespoke message, drop a redundant sort in getXcodeProjectPath, and make the bundle id auto-detection in FlutterApp fall back to manual entry instead of throwing when the Xcode project can't be unambiguously resolved. Adds tests covering the validation wiring and the ambiguous-project fallback.
russellwheatley
left a comment
There was a problem hiding this comment.
Nice fix for #217, this is the right approach. A few things I want to flag and I've pushed a follow up commit addressing them:
-
xcodeProjectFileInDirectoryis also used influtter_app.dartfor bundle id auto detection, which used to degrade gracefully (fall back to manual entry) when the project file was missing. WithgetXcodeProjectPathit now throws if there's zero or multiple.xcodeprojfolders, and this path isn't gated byPlatform.isMacOS, so a non Mac teammate configuring an iOS enabled app could hit a hard failure in an edge case that previously just prompted for a bundle id. I made this tolerant of that again. -
There's already a
PlatformDirectoryDoesNotExistExceptionfor the missing platform directory case, reused it instead of a bespokeXcodeProjectExceptionmessage. -
Added a couple of wiring level tests (through
appleValidationandFlutterApp) since the existing tests only coveredgetXcodeProjectPathin isolation. -
Removed a redundant sort that wasn't needed until building the multi project error message.
Pushed to fix_217 directly since it's not a fork. Tests, analyzer and format all pass.
Description
Fixes support for Flutter Apple projects where the .xcodeproj has been renamed from the default Runner.xcodeproj.
The CLI now discovers the Xcode project under the selected Apple platform directory, preferring Runner.xcodeproj when present and falling back to a single renamed .xcodeproj.
Fixes #217
Type of Change
feat-- New feature (non-breaking change which adds functionality)fix-- Bug fix (non-breaking change which fixes an issue)!-- Breaking change (fix or feature that would cause existing functionality to change)refactor-- Code refactorci-- Build configuration changedocs-- Documentationchore-- Chore