Last active
January 16, 2025 06:47
-
-
Save uhooi/730c7aa286e730b392796a159e4d75f5 to your computer and use it in GitHub Desktop.
XcodeGen project spec sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: {Project Name} | |
options: | |
bundleIdPrefix: {Bundle ID Prefix} | |
deploymentTarget: | |
iOS: 13.0 | |
xcodeVersion: "11.3.1" # 変わらない? | |
# findCarthageFrameworks: true # 余計なフレームワークまで追加されてしまうためコメントアウト | |
carthageExecutablePath: mint run Carthage/Carthage carthage | |
targets: | |
{Project Name}: | |
type: application | |
platform: iOS | |
sources: | |
- {Project Name} | |
- path: "{Project Name}/Generated/MockResults.swift" | |
optional: true | |
type: file | |
- path: "{Project Name}/Generated/R.generated.swift" | |
optional: true | |
type: file | |
settings: | |
base: | |
INFOPLIST_FILE: {Project Name}/Info.plist | |
# PRODUCT_BUNDLE_IDENTIFIER: {Bundle ID Prefix}.{Project Name} # `bundleIdPrefix` を指定しない場合はコメントイン | |
CODE_SIGN_ENTITLEMENTS: Foo/Foo.entitlements | |
dependencies: | |
- carthage: Alamofire | |
- carthage: Moya | |
- carthage: ReactiveMoya | |
- carthage: ReactiveSwift | |
- carthage: RxCocoa | |
- carthage: RxMoya | |
- carthage: RxRelay | |
- carthage: RxSwift | |
preBuildScripts: | |
- script: | | |
"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/$TARGET_NAME/Generated/R.generated.swift" | |
name: Generate Resources with R.swift | |
inputFiles: | |
- $TEMP_DIR/rswift-lastrun | |
outputFiles: | |
- $SRCROOT/$TARGET_NAME/Generated/R.generated.swift | |
- script: | | |
if which mint >/dev/null; then | |
rm -f $SRCROOT/$TARGET_NAME/Generated/MockResults.swift | |
mint run mockolo mockolo --sourcedirs $SRCROOT/$TARGET_NAME --destination $SRCROOT/$TARGET_NAME/Generated/MockResults.swift | |
else | |
echo "warning: Mint not installed, download from https://github.com/yonaskolb/Mint" | |
fi | |
name: Generate Mocks with Mockolo | |
outputFiles: | |
- $SRCROOT/$TARGET_NAME/Generated/MockResults.swift | |
postCompileScripts: | |
- script: | | |
if which mint >/dev/null; then | |
mint run swiftlint swiftlint autocorrect --format | |
mint run swiftlint swiftlint | |
else | |
echo "warning: Mint not installed, download from https://github.com/yonaskolb/Mint" | |
fi | |
name: Run SwiftLint | |
- script: | | |
if ! which mint >/dev/null; then | |
echo "warning: Mint not installed, download from https://github.com/yonaskolb/Mint" | |
exit 0 | |
fi | |
git_path=/usr/local/bin/git | |
files=$($git_path diff --diff-filter=d --name-only -- "*.swift" "*.h" "*.m") | |
if (test -z $files) || (test ${#files[@]} -eq 0); then | |
echo "no files changed." | |
exit 0 | |
fi | |
options="" | |
for file in $files | |
do | |
options="$options $SRCROOT/$file" | |
done | |
mint run SpellChecker SpellChecker --yml $SRCROOT/spell-checker.yml -- $options | |
name: Run SpellChecker | |
{Project Name}Tests: | |
type: bundle.unit-test | |
platform: iOS | |
sources: | |
- {Project Name}Tests | |
settings: | |
base: | |
INFOPLIST_FILE: {Project Name}Tests/Info.plist | |
# PRODUCT_BUNDLE_IDENTIFIER: {Bundle ID Prefix}.{Project Name}Tests | |
dependencies: | |
- target: {Project Name} | |
{Project Name}UITests: | |
type: bundle.ui-testing | |
platform: iOS | |
sources: | |
- {Project Name}UITests | |
settings: | |
base: | |
INFOPLIST_FILE: {Project Name}UITests/Info.plist | |
# PRODUCT_BUNDLE_IDENTIFIER: {Bundle ID Prefix}.{Project Name}UITests | |
dependencies: | |
- target: {Project Name} | |
schemes: | |
{Project Name}: | |
build: | |
targets: | |
{Project Name}: all | |
# {Project Name}Tests: [test] # デフォルト? | |
# {Project Name}UITests: [test] # デフォルト? | |
run: | |
config: Debug | |
test: | |
config: Debug | |
gatherCoverageData: true | |
coverageTargets: | |
- {Project Name} | |
targets: | |
- name: {Project Name}Tests | |
parallelizable: true | |
randomExecutionOrder: true | |
- name: {Project Name}UITests | |
parallelizable: true | |
randomExecutionOrder: true | |
profile: | |
config: Release | |
analyze: | |
config: Debug | |
archive: | |
config: Release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考になりました.ちなみに
xcodeVersion
はのように文字列で指定する必要がありますよ.