GitHub - tuist/xcodeproj: ? Read, update and write your Xcode projects
source link: https://github.com/tuist/xcodeproj
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
xcodeproj
xcodeproj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired in CocoaPods XcodeProj and xcode.
This project is a fork and evolution from xcproj
Projects Using xcodeproj
Project Repository Tuist github.com/tuist/tuist Sourcery github.com/krzysztofzablocki/Sourcery ProjLint github.com/JamitLabs/ProjLint XcodeGen github.com/yonaskolb/XcodeGenIf 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: "6.2.0")), ], targets: [ .target( name: "myproject", dependencies: ["xcodeproj"]), ] )
Carthage
Only macOS
# Cartfile github "tuist/xcodeproj" ~> 6.2.0
CocoaPods
pod 'xcodeproj', '~> 6.2.0'
Migration Guides
xcodeproj 6
xcodeproj 6 is the final step towards hiding the Xcode project implementation details. One of those details was the object unique identifiers, which you used to manage yourself with previous versions. Now, xcodeproj does it for you, so you don't have to pass them around to set dependencies between objects.
This improvement makes the API easier, safer and more convenient, but at the cost of introducing some breaking changes in the library. If want to migrate your project to use xcodeproj 6, these are the things that you should look at:
PBXObjectReference
is an internal class now. Object references to other objects are attributes with the type of the object that is being referred. For example, aXCConfigurationList
object has an attributebuildConfigurations
of typeXCBuildConfiguration
. Adding a new configuration is as easy as callinglist.buildConfigurations.append(config)
.- Note that object references have different types of optionals based on the type of attribute:
PBXObjects
has also been made internal. It was exposed through the attributeobjects
on thePBXProj
class. If you used to use this class for adding, removing, or getting objects, those methods have been moved to thePBXProj
class - Public helpers
And yes, in case you are wondering, it fully supports Xcode 10 ?
xcodeproj 5
xcodeproj
5 is a major release with important changes in the API focused on making it more convenient, and simplify the references handling. This version hasn't been officially released yet but you can already start updating your project for the new version. These are the changes you'd need to make in your projects:
xcproj
has been renamed toxcodeproj
so you need to update all your import statements to use the new name.- There's no support for Carthage nor CocoaPods anymore, if you were using them for fetching
xcodeproj
, you can use the Swift Package Manager and manually setup the dependency. - We've replaced
Path
withAbsolutePath
andRelativePath
from the Swift Package Manager'sBasic
framework. You might need to change some of the usages to use the new type. - Reference attributes have been renamed to use the naming convention
attributeReference
whereattribute
is the name of the attribute. If you are interested in materializing the reference to get the object, objects provide convenient getters that you can use for that purpose. Those getters throw if the object is not found in the project.
There are some useful additions to the API that you can check out on the CHANGELOG.
One of those additions is an improvement on how references are managed. When new objects are added to the project, you get the object reference. The reference is an instance that should be used to refer that object from any other. The value of that reference is an implementation detail that has been abstracted away from you.
Usage
You can check out the documentation on the following link. The documentation is automatically generated in every release by using Jazzy from Realm.
References ?
- Xcode Project File Format
- A brief look at the Xcode project format
- pbexplorer
- pbxproj identifiers
- mob-pbxproj
- Xcodeproj
- Nanaimo
- Facebook Buck
- Swift Package Manager - Xcodeproj
Contributing
- Git clone the repository
[email protected]:tuist/xcodeproj.git
. - Generate xcodeproj with
swift package generate-xcodeproj
. - Open
xcodeproj.xcodeproj
.
License
xcodeproj is released under the MIT license. See LICENSE for details.
Donations
Tuist is a non-profit project run entirely by unpaid volunteers. We need your funds to pay for software, hardware and hosting around continuous integration and future improvements to the project. Every donation will be spent on making Tuist better for our users.
Please consider a regular donation through Patreon:
Open source
Tuist is a proud supporter of the Software Freedom Conservacy
Recommend
-
38
README.md
-
6
了解 Xcode 项目文件 .xcodeproj 了解 Xcode 项目文件 .xcodeprojswift 发布于 2020年12月18日 作为一名开发者, 肯定对 Xcode 的项目文件 .xcodeproj 不陌生了. 我们用 Xcode 创建的任何一个项目...
-
2
Getting Started with Tuist What is Tuist Tuist is a command-line tool that helps you generate, maintain and interact with Xcode projects. It's open-source and written in Swift. The above mean...
-
5
How to add a unit test target to a Tuist project Table of ContentsIn my last post on Getting Started with Tuist, we create a barebone Xcode p...
-
5
Tuist Template: What is it and how to create them Table of ContentsPart 1 in the series "Tuist templates and how to use them". In the first part, we will discuss how to create a template file. ...
-
6
Tuist init: How to use Tuist templates to bootstrap your project Table of ContentsPart 2 in the series "Tuist templates and how to use them". In the second part, we will discuss one of the two ways to use Tui...
-
13
Tuist scaffold: How to use the Tuist template to create a new module for an ongoing project Table of ContentsPart 3 in the series "Tuist templates and how to use them". In the third part, we will discuss anot...
-
5
What is the difference between Tuist init and scaffold Table of ContentsPart 4 in the series "Tuist templates and how to use them". In the final part, I want to wrap up everything by telling you my guideline...
-
3
This branch is 1 commit ahead, 5748 commits behind tuist/tuist:main. Contribute
-
7
mediasoup 3.9.10 worker 的编译及生成 xcodeproj 和 sln 发表于 2022-04-22...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK