XcodeProj
8.26.0
XcodeProj是一个用Swift编写的图书馆,用于解析和使用Xcode Projects。它受到Cocoapods Xcodeproj和Xcode的极大启发。
| 项目 | 存储库 |
|---|---|
| Projlint | github.com/jamitlabs/projlint |
| Rules_xcodeProj | github.com/buildbuddy-io/rules_xcodeproj |
| 橄榄球 | github.com/swiftyfinch/rugby |
| 源 | github.com/krzysztofzablocki/sourcery |
| tuist | github.com/tuist/tuist |
| xcodegen | github.com/yonaskolb/xcodegen |
| XSPM | gitlab.com/pyroh/xspm |
| 隐私清单 | github.com/stelabouras/privacy-manifest |
如果您还利用项目中的Xcodeproj,请随时打开PR以将其包含在上面的列表中。
在Package.swift中添加依赖项。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 " ] ) ,
]
)使用swift-sh您可以使用脚本自动化项目任务,例如,我们可以制作一个脚本,该脚本可以使项目版本键与代表项目版本的当前GIT标签保持同步:
#!/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 )然后,您可以将其存储在您的存储库中,例如在scripts/set-project-version上,然后运行它:
$ scripts/set-project-version ./App.xcodeproj 1.2.3
$ git add App.xcodeproj
$ git commit -m " Bump version "
$ git tag 1.2.3未来的适应性可以轻松地包括确定版本并自动撞击。如果是这样,我们建议使用提供Version对象的库。
[email protected]:tuist/xcodeproj.git 。Package.swift 。用Xcode旋转。 Xcodeproj根据MIT许可发布。有关详细信息,请参见许可证。
谢谢这些好人(表情符号钥匙):
约瑟夫·科利西奥(Joseph Colicchio) ? | deatondg ? | 丹·弗莱明 | Sascha Schwabbauer ? | Marcin Iwanicki ? | 亚当·哈齐(Adam Khazi) ? | 埃利奥特·威廉姆斯 |
muukii ? | Yuya Oka | 基思·史莱西(Keith Smiley) ? | 伊恩·莱奇(Ian Leitch) | Daniil Subbotin | 佛罗伦萨·贝基尔(Florentin Bekier) | 瓦迪姆·史密尔(Vadim Smal) ? |
Freddi(Yuki Aki) | 克里斯托弗·杰克逊 | 杰克·普里克特(Jake Prickett) | 杰克·亚当斯 | 松 | Bogdan Belogurov | 查克·格林德尔(Chuck Grindel) |
迈克尔·麦奎尔(Michael McGuire) | c-凡 | 麦克斯韦·埃利奥特(Maxwell Elliott) | 布伦特利·琼斯 | 团队 | 约翰内斯·埃伯林(Johannes Ebeling) | Baegteun |
Alexkovács | 克里斯托弗·温特克维斯特 | 蒂莫西·科斯塔(Timothy Costa) | 玛丽 | 易卜拉欣·哈桑(Ibrahim Hassan) | tatagrigory | Ruslan Alikhamov |
拉德斯拉斯·德(Ladislas de)告诉了 | 马特·马西科特(Matt Massicotte) | oul | Jaewon-Yun | Mike Gerasymenko | Filip Racki | 开尔文·哈伦 |
乔治·纳瓦罗 | 格言 |
该项目遵循全企业规范。欢迎任何形式的贡献!