Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tuist/xcodeproj
π Read, update and write your Xcode projects
https://github.com/tuist/xcodeproj
ios macos objective-c swift swift-5 xcode xcodeproj
Last synced: 2 days ago
JSON representation
π Read, update and write your Xcode projects
- Host: GitHub
- URL: https://github.com/tuist/xcodeproj
- Owner: tuist
- License: mit
- Created: 2017-06-08T15:12:40.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T22:39:30.000Z (about 2 months ago)
- Last Synced: 2024-10-29T12:57:00.657Z (about 1 month ago)
- Topics: ios, macos, objective-c, swift, swift-5, xcode, xcodeproj
- Language: Swift
- Homepage: https://xcodeproj.tuist.io
- Size: 17.5 MB
- Stars: 2,032
- Watchers: 65
- Forks: 307
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-ios - xcproj - Read and update Xcode projects. (Project setup / Other Parsing)
- awesome-swift - xcodeproj - A library to read, update and write Xcode projects and workspaces. (Misc / Vim)
- awesome-swift - xcodeproj - A library to read, update and write Xcode projects and workspaces. (Misc / Vim)
- fucking-awesome-swift - xcodeproj - A library to read, update and write Xcode projects and workspaces. (Misc / Vim)
- awesome-ios-star - xcproj - Read and update Xcode projects. (Project setup / Other Parsing)
- Awesome-iOS - XcodeProj - Read, update and write your Xcode projects (Tools)
- awesome-swift - xcodeproj - Read, update and write your Xcode projects ` π 10 days ago ` (Misc [π](#readme))
README
# XcodeProj
[![All Contributors](https://img.shields.io/badge/all_contributors-44-orange.svg?style=flat-square)](#contributors-)
[![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/)
[![Release](https://img.shields.io/github/release/tuist/xcodeproj.svg)](https://github.com/tuist/xcodeproj/releases)
[![Code Coverage](https://codecov.io/gh/tuist/xcodeproj/branch/main/graph/badge.svg)](https://codecov.io/gh/tuist/xcodeproj)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftuist%2FXcodeProj%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/tuist/XcodeProj)XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired by [CocoaPods XcodeProj](https://github.com/CocoaPods/Xcodeproj) and [xcode](https://www.npmjs.com/package/xcode).
---
- [XcodeProj](#xcodeproj)
- [Projects Using XcodeProj](#projects-using-xcodeproj)
- [Installation](#installation)
- [Swift Package Manager](#swift-package-manager)
- [Scripting](#scripting)
- [References π](#references-)
- [Contributing](#contributing)
- [License](#license)
- [Contributors β¨](#contributors-)## Projects Using XcodeProj
| Project | Repository |
| --------------- | -------------------------------------------------------------------------------------------- |
| ProjLint | [github.com/JamitLabs/ProjLint](https://github.com/JamitLabs/ProjLint) |
| rules_xcodeproj | [github.com/buildbuddy-io/rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj) |
| Rugby | [github.com/swiftyfinch/Rugby](https://github.com/swiftyfinch/Rugby) |
| Sourcery | [github.com/krzysztofzablocki/Sourcery](https://github.com/krzysztofzablocki/Sourcery) |
| Tuist | [github.com/tuist/tuist](https://github.com/tuist/tuist) |
| XcodeGen | [github.com/yonaskolb/XcodeGen](https://github.com/yonaskolb/XcodeGen) |
| xspm | [gitlab.com/Pyroh/xspm](https://gitlab.com/Pyroh/xspm) |
| Privacy Manifest| [github.com/stelabouras/privacy-manifest](https://github.com/stelabouras/privacy-manifest) |If you are also leveraging XcodeProj in your project, feel free to open a PR to include it in the list above.
## Installation
### Swift Package Manager
Add the dependency in your `Package.swift` file:
```swift
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"]),
]
)
```### Scripting
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:```swift
#!/usr/bin/swift sh
import Foundation
import XcodeProj // @tuist ~> 8.8.0
import PathKitguard CommandLine.arguments.count == 3 else {
let arg0 = Path(CommandLine.arguments[0]).lastComponent
fputs("usage: \(arg0) \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:```bash
$ scripts/set-project-version ./App.xcodeproj 1.2.3
$ git add App.xcodeproj
$ git commit -m "Bump version"
$ git tag 1.2.3
```Future adaption could easily include determining the version and bumping it
automatically. If so, we recommend using a library that provides a `Version`
object.[`swift-sh`]: https://github.com/mxcl/swift-sh
## References π
- [Xcode Project File Format](http://www.monobjc.net/xcode-project-file-format.html)
- [pbexplorer](https://github.com/mjmsmith/pbxplorer)
- [pbxproj identifiers](https://pewpewthespells.com/blog/pbxproj_identifiers.html)
- [mob-pbxproj](https://github.com/kronenthaler/mod-pbxproj)
- [Xcodeproj](https://github.com/CocoaPods/Xcodeproj)
- [Nanaimo](https://github.com/CocoaPods/Nanaimo)
- [Facebook Buck](https://buckbuild.com/javadoc/com/facebook/buck/apple/xcode/xcodeproj/package-summary.html)## Contributing
1. Git clone the repository `[email protected]:tuist/xcodeproj.git`.
2. Open `Package.swift` with Xcode.## License
XcodeProj is released under the MIT license. [See LICENSE](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md) for details.
## Contributors β¨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Joseph Colicchio
π€
deatondg
π€
Dan Fleming
π»
Sascha Schwabbauer
π€
Marcin Iwanicki
π§
Adam Khazi
π§
Elliott Williams
π»
Muukii
π
Yuya Oka
π»
Keith Smiley
π
Ian Leitch
π»
Daniil Subbotin
π»
Florentin Bekier
π»
Vadim Smal
π
freddi(Yuki Aki)
π»
Kristopher Jackson
π»
Jake Prickett
π»
Jake Adams
π»
matsuji
π»
Bogdan Belogurov
π»
Chuck Grindel
π»
Michael McGuire
π»
C-ε‘
π»
Maxwell Elliott
π»
Brentley Jones
π»
Teameh
π»
Johannes Ebeling
π»
baegteun
π
Alex KovΓ‘cs
π
Christoffer Winterkvist
π»
Timothy Costa
π»
Mary
π»
Md. Ibrahim Hassan
π»
tatagrigory
π»
Ruslan Alikhamov
π»
Ladislas de Toldi
π»
Matt Massicotte
π»
ΠΡΡΠ΅ΠΌ ΠΠΎΡΡ Π»ΠΈΠΊ
π»
Jaewon-Yun
π»
Mike Gerasymenko
π»
Filip Racki
π»
Kelvin Harron
π»
George Navarro
π»
Maxim
π»
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!