rules_xcodeproj is distributed through Bzlmod, the modern Bazel dependency management system introduced in Bazel 6 and made the default in Bazel 7. Bzlmod is the only supported installation method — WORKSPACE-based installation was removed in rules_xcodeproj 4.0.0 (see warning below).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MobileNativeFoundation/rules_xcodeproj/llms.txt
Use this file to discover all available pages before exploring further.
Bzlmod resolves transitive dependencies automatically, so you only need a single
bazel_dep declaration. All of rules_xcodeproj’s own dependencies — apple_support, rules_swift, rules_apple, and others — are fetched and version-resolved for you.Installation Steps
Find the Latest Release
Visit the rules_xcodeproj releases page on GitHub and note the version number of the latest stable release (for example,
4.1.0). Each release page contains a ready-to-copy Bzlmod snippet.Add the bazel_dep to MODULE.bazel
Open your workspace’s For example, for version 4.1.0:Place this alongside any other
MODULE.bazel file and add the following declaration, substituting the actual latest version number:MODULE.bazel
MODULE.bazel
bazel_dep declarations at the top of your MODULE.bazel.Load the Module Extension
rules_xcodeproj ships a module extension that fetches the Swift tool binaries it needs at analysis time. After the
bazel_dep declaration, register the extension and pull in its repositories:MODULE.bazel
When rules_xcodeproj is consumed as an external dependency (i.e., in your own workspace rather than in the rules_xcodeproj repo itself), the extension path becomes
@rules_xcodeproj//xcodeproj:extensions.bzl. The snippet above is taken verbatim from rules_xcodeproj’s own MODULE.bazel and will typically appear in the release-page Bzlmod snippet already adapted for consumer use.Minimum Bazel Version
rules_xcodeproj requires Bazel 8.0.0 or later, as declared in itsMODULE.bazel:
MODULE.bazel
Key Transitive Dependencies
When you add rules_xcodeproj via Bzlmod, the following core dependencies are automatically resolved. You do not need to declare these yourself unless you want to pin them to specific versions for other reasons:| Dependency | Minimum Version (resolved by rules_xcodeproj) | Purpose |
|---|---|---|
apple_support | 2.2.0 | Apple platform toolchain support |
rules_swift | 3.5.0 | Swift compilation rules |
rules_apple | 4.4.0 | Apple platform application bundling rules |
bazel_skylib | 1.9.0 | Common Bazel utilities |
rules_cc | 0.2.17 | C/C++ compilation rules |
rules_python | 1.7.0 | Python support for generator tooling |
Next Steps
With rules_xcodeproj installed, you’re ready to define your firstxcodeproj target and generate an Xcode project.
Quickstart
Generate your first Xcode project from a Bazel iOS app in minutes.