• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

tungdev1209/xcode-ci: CI iOS/MacOS app via command-line

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

tungdev1209/xcode-ci

开源软件地址(OpenSource Url):

https://github.com/tungdev1209/xcode-ci

开源编程语言(OpenSource Language):

Shell 71.6%

开源软件介绍(OpenSource Introduction):

xcode-ci

Description

CI iOS/MacOS app via command line.

Requirements

xcodebuild

Install

$ brew tap tungdev1209/xcode-ci
$ brew install xcode-ci

Initialize

$ cd path/to/ios/project
$ xcode-ci init

Ex:

$ cd /Users/tungdev1209/Projects/iOS/HelloWorld
$ xcode-ci init

Adjust default value

After initialized, .ci dir is created automatically, then you have to adjust params in both deploy_config.json and export_config.plist (ignore this file if you don't want to export)

=> ./.ci/deploy_config.json

{
    "project_path":".",
    "project_name":"HelloWorld.xcodeproj",
    "build_path":"./Build",
    "build_scheme":"HelloWorld",
    "archive_path":"./Archive",
    "archive_scheme":"HelloWorld",
    "build_args":"clean",
    "test_args":"",
    "archive_args":"",
    "export_args":""
}

=> ./.ci/export_config.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>compileBitcode</key>
	<true/>
	<key>method</key>
	<string>enterprise</string>
	<key>provisioningProfiles</key>
	<dict>
		<key>com.tungdev1209.helloworld</key>
		<string>70f47xxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</string>
	</dict>
	<key>signingCertificate</key>
	<string>iPhone Distribution</string>
	<key>signingStyle</key>
	<string>manual</string>
	<key>stripSwiftSymbols</key>
	<true/>
	<key>thinning</key>
	<string>&lt;none&gt;</string>
</dict>
</plist>

Command

Syntax:

$ xcode-ci <command>
  • init [-f/--force] : Initialize ci components (-f force re-init)
  • -b/--build 'build args' : Additional Build command arguments (plus build_args value in deploy_config.json in order to make final Build command)
  • -t/--test 'test args' : Additional Test command arguments (plus test_args value in deploy_config.json in order to make final Test command)
  • -a/--archive 'archive args' : Additional Archive command arguments (plus archive_args value in deploy_config.json in order to make final Archive command)
  • -e/--export 'export args' : Additional Export command arguments (plus export_args value in deploy_config.json in order to make final Export command)
  • -fw/--framework 'u.d.s' : Indicate this is the framework project, 'u' if you just want to export Universal framework, 'd' => Device framework and 's' => Simulator framework, 'u.d' if you would both Universal & Device frameworks. Default: export all kind of frameworks if you just -fw, if you don't -fw, xcode-ci understand this is normal application project
  • -r/--run 'b.t.a.e' : Indicate whether ci process will be run or not, 'b' if you just want to run Build process, 't' => Test process, 'a' => Archive process and 'e' => Export process, 'a.e' if you would like to run Archive and then Export process. Default: run all kind of processes one by one (Build -> Test -> Archive -> Export) if you don't type -r
  • -v/--version : show the version

Default arguments

By default, xcode-ci detect current type of project you would like to build (whether project or workspace) by project_name value (whether .xcodeproj or .xcworkspace) in deploy_config.json in order to make final Build command

  • Build : -project/-workspace project_path/project_name -scheme build_scheme -sdk iphonesimulator -configuration Debug ONLY_ACTIVE_ARCH=NO build
  • Test : same default Build args + test
  • Archive : -project/-workspace project_path/project_name -scheme archive_scheme -archivePath archive_path/archive_scheme.xcarchive -configuration Release archive
  • Export : -exportArchive -archivePath archive_path/archive_scheme.xcarchive -exportOptionsPlist ./.ci/export_config.plist -exportPath archive_path/export_path (export_path: auto generate each time xcode-ci run Export process)

You could override above args via deploy_config.json and xcode-ci command

Hooks

$ xcode-ci

Above command means: xcode-ci will run all of the processes one by one (Build -> Test -> Archive -> Export) with config files (deploy_config.json and export_config.plist). Before and after each process, xcode-ci allow you add more processes you would like to run via ./hooks file

  • pre_build.sh
  • pre_test.sh
  • post_build.sh
  • post_test.sh
  • pre_archive.sh
  • post_archive.sh
  • pre_export.sh
  • post_export.sh

Example:

'The right example is worth 1000 lines of documentation'. I belive it!

=> For normal project:

$ xcode-ci -r 'b'

=> For framework project:

$ xcode-ci -fw 'u.d' -r 'a.e'

License

This project is licensed under the terms of the MIT license.

Have fun!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
rlxone/Equinox: 发布时间:2022-08-18
下一篇:
soto-project/soto: Swift SDK for AWS that works on Linux, macOS and iOS发布时间:2022-08-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap