Go to file
Simon Kågedal Reimer 50858eaa50 Add missing call to add object in xcodeproject 2019-03-03 10:39:53 +01:00
Sources/xcodeproj-modify Add missing call to add object in xcodeproject 2019-03-03 10:39:53 +01:00
Tests Initial commit 2019-02-11 09:15:18 +01:00
.gitignore Initial commit 2019-02-11 09:15:18 +01:00
LICENSE Initial commit 2019-02-11 09:15:18 +01:00
Package.resolved Initial commit 2019-02-11 09:15:18 +01:00
Package.swift Add tool as build product 2019-02-11 09:26:04 +01:00
README.md Update README 2019-02-11 09:36:21 +01:00

README.md

xcodeproj-modify

This microtool, despite its very generic name, currently only performs one very specific task: adds a Run Script phase to an Xcode project.

The use case is when you have an ephemeral Xcode project that is regenerated by Swift Package Manager and you want to add a Run Script phase to integrate SwiftLint.

Usage

$ xcodeproj-modify MyProject.xcodeproj add-run-script-phase MyTarget swiftlint

This will edit your Xcode project MyProject.xcodeproj and add a Run Script phase to the MyTarget target that runs swiftlint. Since you specify the script as a command line parameter to the tool, it gets unwieldy if it's a lot of code, so in that case I'd recommend putting it in a script and pass that as the code to add-run-script-phase.

Installation

Using Mint:

$ mint install skagedal/xcodeproj-modify

You may also add the tool as a SPM dependency in your Package.swift and then run it with swift run xcodeproj-modify. As an example, see how this is done in my tool (generate-xcodeproj.sh, Package.swift).