Skip to content

dev: add prepare-packages to provide an Xcode project's packages ahead of a build - #466

Open
ap-1 wants to merge 1 commit into
xtool-org:pre/2.xfrom
ap-1:prepare-packages
Open

ap-1 wants to merge 1 commit into
xtool-org:pre/2.xfrom
ap-1:prepare-packages

Conversation

@ap-1

@ap-1 ap-1 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds xtool dev prepare-packages, which creates the directory xtool uses for an Xcode project's Swift packages.

Offline builds like Nix's can then provide those dependencies themselves before running xtool dev build.

How was it tested?

Built a Capacitor app's Xcode project in a Nix build without network access, after setting up its dependencies with xtool dev prepare-packages.

AI tool usage

How much of the code in this PR was AI-assisted? (check one)

  • 0 - No AI was used to write code
  • 1 - I was assisted by AI in writing code. I reviewed the finished result.
  • 2 - I set the AI going and left it to it; nobody has read the result - no review, or AI review only

Summary by CodeRabbit

  • New Features
    • Added a dev prepare-packages command to prepare an Xcode project’s Swift packages and display the resulting directory path. The command reports an error if the project has no Swift package references.
  • Bug Fixes
    • Improved build description support for both Xcode projects and workspaces.

Signed-off-by: Anish Pallati <i@anish.land>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes add a dev prepare-packages command for Xcode projects. XcodePackagePIFBuilder now exposes package preparation through prepare(), and build() uses that method. XcodeBuildDescriber now selects a workspace or project PIF builder through a helper.

Changes: Xcode Package Preparation

Layer / File(s) Summary
Select and prepare package PIF
Sources/XToolSupport/XcodeBuildDescriber.swift, Sources/XToolSupport/XcodePackagePIFBuilder.swift
XcodeBuildDescriber selects a workspace or project PIF builder through pifBuilder(). XcodePackagePIFBuilder.prepare() returns nil when there are no package references; otherwise it generates the manifest and returns the prepared directory. build() uses prepare() and returns an empty project list when preparation returns nil.
Add the dev prepare-packages command
Sources/XToolSupport/DevCommand.swift
The command discovers the current project, rejects non-Xcode projects, errors when there are no Swift package references, and prints the prepared directory path. It is registered as a dev subcommand.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: kabiroberai

Merge Risk: Minimal · up to c314f

This adds an xtool dev prepare-packages command and refactors package preparation without changing the build path. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a new dev prepare-packages subcommand that prepares an Xcode project's Swift packages before a build. The raw summary confirms the new subcommand in DevCommand.swift…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a new dev prepare-packages subcommand that prepares an Xcode project's Swift packages before a build. The raw summary confirms the new subcommand in DevCommand.swift, and the PR objectives describe the same purpose, letting offline builds such as Nix supply dependencies. The supporting refactors in XcodeBuildDescriber.swift and XcodePackagePIFBuilder.swift serve this feature. The title is specific and accurate, and it is not vague.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1eb23c13-85c7-4348-809e-63c64d81f34a
Commits

Reviewing files that changed from the base of the PR and between 73dc5f1 and c314fe3.

Files selected for processing: 3

  • Sources/XToolSupport/DevCommand.swift
  • Sources/XToolSupport/XcodeBuildDescriber.swift
  • Sources/XToolSupport/XcodePackagePIFBuilder.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant