Swift Package Manager Release Code Coverage License
XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired by CocoaPods XcodeProj and xcode.
| Project | Repository |
|---|---|
| ProjLint | github.com/JamitLabs/ProjLint |
| rules_xcodeproj | github.com/buildbuddy-io/rules_xcodeproj |
| Rugby | github.com/swiftyfinch/Rugby |
| Sourcery | github.com/krzysztofzablocki/Sourcery |
| Tuist | github.com/tuist/tuist |
| XcodeGen | github.com/yonaskolb/XcodeGen |
| xspm | gitlab.com/Pyroh/xspm |
| Privacy Manifest | github.com/stelabouras/privacy-manifest |
| XcodeProjectCLI | github.com/wojciech-kulik/XcodeProjectCLI |
If you are also leveraging XcodeProj in your project, feel free to open a PR to include it in the list above.
Add the dependency in your Package.swift file:
let package = Package( name: "myproject", dependencies: [ .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.12.0")), ], targets: [ .target( name: "myproject", dependencies: ["XcodeProj"]), ] )
Using swift-sh you can automate project-tasks using scripts, for example we
can make a script that keeps a projectβs version key in sync with the current
git tag that represents the projectβs version:
#!/usr/bin/swift sh import Foundation import XcodeProj // @tuist ~> 8.8.0 import PathKit guard CommandLine.arguments.count == 3 else { let arg0 = Path(CommandLine.arguments[0]).lastComponent fputs("usage: \(arg0) <project> <new-version>\n", stderr) exit(1) } let projectPath = Path(CommandLine.arguments[1]) let newVersion = CommandLine.arguments[2] let xcodeproj = try XcodeProj(path: projectPath) let key = "CURRENT_PROJECT_VERSION" for conf in xcodeproj.pbxproj.buildConfigurations where conf.buildSettings[key] != nil { conf.buildSettings[key] = newVersion } try xcodeproj.write(path: projectPath)
You could then store this in your repository, for example at
scripts/set-project-version and then run it:
$ scripts/set-project-version ./App.xcodeproj 1.2.3
$ git add App.xcodeproj
$ git commit -m "Bump version"
$ git tag 1.2.3Future adaption could easily include determining the version and bumping it
automatically. If so, we recommend using a library that provides a Version
object.
- Xcode Project File Format
- pbexplorer
- pbxproj identifiers
- mob-pbxproj
- Xcodeproj
- Nanaimo
- Facebook Buck
- Git clone the repository
git@github.com:tuist/xcodeproj.git. - Open
Package.swiftwith Xcode.
XcodeProj is released under the MIT license. See LICENSE for details.
Thanks goes to these wonderful people (emoji key):
Joseph Colicchio
π€ deatondg
deatondg
π€ Dan Fleming
Dan Fleming
π» Sascha Schwabbauer
Sascha Schwabbauer
π€ Marcin Iwanicki
Marcin Iwanicki
π§ Adam Khazi
Adam Khazi
π§ Elliott Williams
Elliott Williams
π»
Muukii
π Yuya Oka
Yuya Oka
π» Keith Smiley
Keith Smiley
π Ian Leitch
Ian Leitch
π» Daniil Subbotin
Daniil Subbotin
π» Florentin Bekier
Florentin Bekier
π» Vadim Smal
Vadim Smal
π
freddi(Yuki Aki)
π» Kristopher Jackson
Kristopher Jackson
π» Jake Prickett
Jake Prickett
π» Jake Adams
Jake Adams
π» matsuji
matsuji
π» Bogdan Belogurov
Bogdan Belogurov
π» Chuck Grindel
Chuck Grindel
π»
Michael McGuire
π» C-ε‘
C-ε‘
π» Maxwell Elliott
Maxwell Elliott
π» Brentley Jones
Brentley Jones
π» Teameh
Teameh
π» Johannes Ebeling
Johannes Ebeling
π» baegteun
baegteun
π
Alex KovΓ‘cs
π Christoffer Winterkvist
Christoffer Winterkvist
π» Timothy Costa
Timothy Costa
π» Mary
Mary
π» Md. Ibrahim Hassan
Md. Ibrahim Hassan
π» tatagrigory
tatagrigory
π» Ruslan Alikhamov
Ruslan Alikhamov
π»
This project follows the all-contributors specification. Contributions of any kind welcome!