Skip to content
This repository was archived by the owner on Nov 25, 2023. It is now read-only.

XcodeMigrate/XcodeMigrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

eaae787 · Jan 10, 2023

History

35 Commits
Jan 6, 2023
Jan 10, 2023
Jan 10, 2023
Jan 10, 2023
Jan 6, 2023
Jan 8, 2023
Jan 5, 2023
Dec 31, 2022
Dec 31, 2022
Dec 23, 2022
Jan 5, 2023
Jan 8, 2023
Jan 6, 2023

Repository files navigation

XcodeMigrate

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.

Why XcodeMigrate?

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.

Goals

  • 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

Usage

mint install XcodeMigrate/XcodeMigrate@main
mint run xcode-migrate generate -p /path/to/your.xcodeproj

Demo Project

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

Design

  • 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)

Attributions

This tool is powered by:

Inspired by:

Contributing to XcodeMigrate

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.

Get Started

Requirements

  • Xcode 14.0 or later (Swift 5.7 or later)

Run the project

swift run XcodeMigrate

License

XcodeMigrate is released under the MIT license. See LICENSE for details.