• Stars
    star
    2,028
  • Rank 22,829 (Top 0.5 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 7 years ago
  • Updated 29 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“ Read, update and write your Xcode projects

XcodeProj

Netlify Status

All Contributors

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.


Projects Using XcodeProj

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

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:

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:

#!/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.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.

Documentation πŸ“

Want to start using XcodeProj? Start by digging into our documentation which will help you get familiar with the API and get to know more about the Xcode projects structure.

References πŸ“š

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 for details.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Joseph Colicchio
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
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)
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
Michael McGuire

πŸ’»
C-凑
C-凑

πŸ’»
Maxwell Elliott
Maxwell Elliott

πŸ’»
Brentley Jones
Brentley Jones

πŸ’»
Teameh
Teameh

πŸ’»
Johannes Ebeling
Johannes Ebeling

πŸ’»
baegteun
baegteun

πŸ“–
Alex KovΓ‘cs
Alex KovΓ‘cs

πŸ“–
Christoffer Winterkvist
Christoffer Winterkvist

πŸ’»
Timothy Costa
Timothy Costa

πŸ’»
Mary
Mary

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

tuist

Tuist's CLI
Swift
4,573
star
2

microfeatures-guidelines

πŸ“¦πŸ“ uFeatures guidelines
311
star
3

microfeatures-example

πŸ“¦πŸ“± Example of iOS app built using the uFeatures architecture
Swift
193
star
4

awesome-tuist

A community-driven collection of Tuist related posts, plugins, talks, and much more.
190
star
5

SwiftyTailwind

πŸ’‡ A Swift Package to pull and run Tailwind from a Swift process
Swift
60
star
6

Command

πŸ“¦ A micro Swift package with utilities for running system processes
Swift
38
star
7

tuist-plugin-lint

A plugin that extends Tuist with SwiftLint functionalities.
Swift
37
star
8

XcodeGraph

፨ A Swift Package with data structures to model Xcode workspaces and projects
Swift
32
star
9

tuist-action

A GitHub action to run Tuist from GitHub workflows
JavaScript
25
star
10

SwiftTerminal

πŸš€ A set of UI components for building terminal applications in Swift
Swift
16
star
11

Path

πŸ’» Types to model file-system paths.
Swift
14
star
12

AppleArtifactAnalyzer

πŸ“¦ A Swift Package to analyze artefacts generated by Apple
Swift
14
star
13

FileSystem

πŸ“ A platform-agnostic Swift Package to interact with the file system
Swift
14
star
14

xcodehero

πŸ¦Έβ€β™€οΈ A better version of "xcodebuild" built for the talk at Swift Heroes 2024
Swift
14
star
15

SwiftyRipgrep

πŸ”Ž A package that wraps ripgrep and provides a Swift interface. For macOS and iOS
Swift
11
star
16

macker

Virtualized macOS environments using Apple's virtualization framework
Swift
9
star
17

ProjectAutomation

Swift
8
star
18

virtualOS

A CLI to virtualize macOS environments
Swift
8
star
19

lightning_css

🎨 A wrapper to integrate LighningCSS into Elixir projects
Elixir
8
star
20

swiftable-tuist-workshop

This repository contains the content for the Shiftable 2023 workshop about Tuist
Shell
7
star
21

homebrew-tuist

Official Homebrew Tuist formula.
Ruby
6
star
22

tuist-up

A CLI too powered by Swift to provision environments using an up.toml manifest file
Swift
6
star
23

ProjectDescription

Swift
6
star
24

swift-on-server-examples

🌍 Examples using Tuist with Swift on Server applications
Swift
6
star
25

swift-log-testing

πŸ“ A set of utilities for testing code that depends on Apple's swift-log package
Swift
6
star
26

bitrise-step-tuist

⚑️ A step to run Tusit from Bitrise pipelines
Shell
5
star
27

XcodeProjCExt

πŸ‘©β€πŸ’»C extensions for XcodeProj
C
5
star
28

newsletter

βœ‰οΈ The Listmonk deployment setup and a directory of ideas for future newsletters
HTML
5
star
29

Glob

A Swift Package for fast file-system globbing
Swift
5
star
30

XcodeProjectGenerator

🌈 A Swift Package to generate Xcode projects
Swift
5
star
31

tuist-vapor-example

An example Vapor project using Tuist
Swift
4
star
32

ExampleTuistPlugin

This is an example Tuist plugin for testing purposes.
Swift
3
star
33

website

Tuist static website
Astro
3
star
34

example

πŸ“±This repository contains an example iOS modular app described with Tuist
Swift
3
star
35

scalar_plug

πŸ“ Integrate Scalar-generated documentation into your Plug-based Elixir app
Elixir
3
star
36

cross-arch-compilation-with-macros

A Swift Package project to reproduce an issue compiling Swift Packages with Macros
Swift
3
star
37

app

🍎 A cross-platform Apple-native dashboard for your Tuist projects
3
star
38

handbook

πŸ“š Tuist's company handbook
JavaScript
3
star
39

reproduce-nio-bad-access-exc

A repository to reproduce a BAD_ACESS exception using NIO and Tuist
Swift
2
star
40

swift-macros-security

πŸ“¦ This repository contains an experiment to assess how secure Swift Macros are
Swift
2
star
41

issue-swift-macros-editor

Shell
2
star
42

ExampleTuistTemplate

This is an example Tuist template for testing purposes.
Swift
2
star
43

swift-sdk-for-dagger

🚘 Swift SDK for Dagger
Swift
2
star
44

SwiftyGlob

πŸ’¨ A fast globbing library for Swift
2
star
45

decks

Swift
2
star
46

.github

A repository that contains the organization's README
2
star
47

asdf-virtualos

⬇️ An asdf plugin to install virtualOS
Shell
2
star
48

old-docs

πŸ“„ Tuist's documentation website
JavaScript
2
star
49

asdf-xcodehero

Shell
2
star
50

SwiftyESBuild

πŸš‡ A Swift Package to run ESBuild
2
star
51

tuist-orb

πŸš€ Easily install and run Tuist in your CircleCI jobs
Shell
1
star
52

fuckingswiftconcurrency

A learning resource to familiarise with Swift's concurrency
1
star
53

asdf-sourcedocs

An asdf plugin to install sourcedocs
Shell
1
star
54

ai

A configuration to deploy Ollama to our infrastructure
1
star
55

catalysis

πŸš€ A local-first CLI to deploy static sites to multiple platforms
Rust
1
star
56

gestalt

πŸ“ An open-source Apple-native knowledge-management tool
Swift
1
star
57

cloud

☁️ Open source Tuist Cloud implementation (deprecated)
TypeScript
1
star
58

package-with-circular-target-deps

Swift
1
star
59

dependencies

πŸ“¦ A tiny package for dependency-injection in Swift
Swift
1
star