feat(generate): add --dry-run flag to diff project without writing#1610
Open
samuraisatoshi wants to merge 1 commit intoyonaskolb:masterfrom
Open
feat(generate): add --dry-run flag to diff project without writing#1610samuraisatoshi wants to merge 1 commit intoyonaskolb:masterfrom
samuraisatoshi wants to merge 1 commit intoyonaskolb:masterfrom
Conversation
Adds a new --dry-run flag to the generate command that generates the Xcode project in memory and prints a JSON diff of what would change compared to the existing project on disk, without writing any files. New type ProjectDiff captures added/removed/modified file keys in the pbxproj and serialises them as JSON. Co-Authored-By: Claude Sonnet 4.6 <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
Adds a
--dry-runflag to thegeneratecommand that generates the Xcode project entirely in memory and prints a JSON diff of what would change — without writing any files to disk.This is useful for:
Changes
GenerateCommand.swift: new--dry-runflag; when set, callsProjectDiffand prints JSON then returns earlyProjectDiff.swift(new): lightweight struct that compares an in-memoryXcodeProjagainst an existing.xcodeprojon disk and captures added/removed/modified PBX object keysJSON output example
{ "added": ["ABC123", "DEF456"], "modified": ["GHI789"], "removed": [] }Test plan
xcodegen generate --dry-runon an existing project — verify JSON output, no files written.xcodeproj— all keys should appear inaddedswift test🤖 Generated with Claude Code