tomlokhorst / XcodeEdit

Swift library for reading and writing Xcode project files in OpenStep format
MIT License
206 stars 38 forks source link
XcodeEdit

Reading and writing the Xcode pbxproj file format, from Swift!

The main goal of this project is to generate project.pbxproj files in the legacy OpenStep format used by Xcode. Using this, a project file can be modified without changing it to XML format and causing a huge git diff.

Currently, this project is mostly used to support R.swift.

⚠️ Limited support for modificiation

At this time, there are only limited APIs for modifying a project file. Only features that are actually needed by R.swift are implemented. There is no generic way to modify the project strucuture.

Usage

This reads a xcodeproj file (possibly in XML format), and writes it back out in OpenStep format:

let xcodeproj = URL(fileURLWithPath: "Test.xcodeproj")

let proj = try! XCProjectFile(xcodeprojURL: xcodeproj)

try! proj.write(to: xcodeproj, format: PropertyListSerialization.PropertyListFormat.openStep)

Releases

Licence & Credits

XcodeEdit is written by Tom Lokhorst and available under the MIT license, so feel free to use it in commercial and non-commercial projects.