Generate Bazel BUILD files from Xcode projects.
Long term plans:
This project is still in its early stages. It is not yet ready for production use. If you have any questions or ideas, please feel free to open a discussion.
Over nearly ten years of my personal experience of Apple development, I strongly believe that developers should be able to keep focused on creative things rather than wasting time on compile time.
Bazel is designed for this purpose.
However, migrating existing (large) Xcode project to Bazel is not easy. It requires a lot of manual work.
BazelMigrate
is created to help developers to migrate existing Xcode projects to Bazel with minimal manual work.
- Ready to use out of the box, minimal configuration for most projects
- Fully support rules_xcodeproj
- Mixed language target (Objective-C/Swift) generation using rules_ios
mint install XcodeMigrate/XcodeMigrate@main
mint run xcode-migrate generate -p /path/to/your.xcodeproj
At current stage, xcode-migrate
only supports generating Bazel files for iOS projects with Swift only frameworks.
You can try the testing project under fixtures directory. There is an example in .github/workflows/swift.yml.
We are tracking generated Bazel files in this repository. You can build the project with Bazel by running:
git clone https://github.com/XcodeMigrate/XcodeMigrate.git
cd XcodeMigrate/fixtures/basic
tuist generate # Generating Info.plist files
bazel build //:BasicFixtureProject --sandbox_debug --verbose_failures
- End-to-end testing with Xcode projects generated by Tuist
- Decoupling Xcode project parser and generator
XcodeMigrate
├─XcodeParser - Parsing layer
│ └─XcodeProj
├─XcodeAbstraction - Modeling layer (without any dependency to XcodeProj)
├─BazelGenerator - Bazel generation layer
├─BazelRenderingKit - Bazel content rendering layer
├─Common - Shared logic such as logging and configuration structs
├─FoundationExtension - Extensions to Foundation
└─TestSupport - Test helpers
(Created by Diagon)
This tool is powered by:
Inspired by:
We'd love to accept your patches and contributions to this project. Please feel free to open a pull request, an issue, or a discussion.
- Xcode 14.0 or later (Swift 5.7 or later)
swift run XcodeMigrate
XcodeMigrate is released under the MIT license. See LICENSE for details.