Migrate generator from JSON API to @bacons/xcode Object API#2
Merged
Conversation
Add a compare-output script and ignore its output, and refactor the Xcode project generator to use @bacons/xcode's Object API. - Add scripts/compare-output.ts to generate projects for multiple platforms, validate pbxproj structure, and save .pbxproj outputs under .compare-output/ for manual inspection; add .compare-output to .gitignore. - Rewrite src/generator.ts to build an XcodeProject via @bacons/xcode classes (XcodeProject, PBXGroup, PBXFileReference, PBXNativeTarget, PBXSourcesBuildPhase, PBXFrameworksBuildPhase, PBXResourcesBuildPhase, XCBuildConfiguration, XCConfigurationList) instead of manual UUID/object map construction. - Simplify file-type handling with helper predicates (isSourceFileType, isResourceFileType) and consolidate build/target/project settings into shared settings objects. These changes remove ad-hoc UUID generation and manual object assembly, leveraging the library's Object API for more robust pbxproj generation and easier validation.
Replace raw createModel() calls for build phases with target.getSourcesBuildPhase() / getFrameworksBuildPhase() / getResourcesBuildPhase(). Use createGroup/createFile on groups instead of manually wiring children. Inline config list creation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@bacons/xcodeObject API (PBXGroup.create,PBXNativeTarget.create,XCBuildConfiguration.create, etc.)target.getSourcesBuildPhase()/getFrameworksBuildPhase()/getResourcesBuildPhase()instead of rawcreateModel()calls — build phases get defaults automaticallylastKnownFileType) and source tree defaults handled byPBXFileReference.setupDefaults(), eliminating the hand-maintainedFILE_TYPESmap andisSourceFile/isResourceFileextension listsscripts/compare-output.tsto validate generated projects across all 6 platformsTest plan
bunx tsc --noEmitpasses cleanbun scripts/compare-output.ts— all 6 platforms (ios, macos, tvos, watchos, visionos, multiplatform) pass structural checksxcodebuildsucceeds for iOS and macOS generated projects🤖 Generated with Claude Code