-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.yml
214 lines (206 loc) · 8.51 KB
/
project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: Dokoiko
# Build Configurations
configs:
Debug: debug
Release: release
options:
bundleIdPrefix: com.tyomashin
deploymentTarget:
iOS: 13.0
developmentLanguage: ja
# xcodeVersion: "12.3"
# carthageExecutablePath: mint run Carthage/Carthage carthage
# Build Settings
# ターゲットに依存しない設定
settings:
# Common
base:
MARKETING_VERSION: 1.0.0
CURRENT_PROJECT_VERSION: 4
DEVELOPMENT_TEAM: 38BV25GUUS
# SWIFT_VERSION: 5
# PRODUCT_NAME: $TARGET_NAME
# Xcode 12.3 で、以下のパラメータが欠落しているとのことなので明示的に指定(デフォルト値)
# 参考:https://stackoverflow.com/questions/63267897/building-for-ios-simulator-but-the-linked-framework-framework-was-built
VALIDATE_WORKSPACE: NO
# 一部のフレームワークでBitCode対応がされていないものがあるためNo指定
ENABLE_BITCODE: NO
OTHER_LDFLAGS: -ObjC
CODE_SIGN_STYLE: Manual
configs:
Debug:
GCC_PREPROCESSOR_DEFINITIONS: DEVELOP=1
OTHER_SWIFT_FLAGS: -D DEVELOP
CODE_SIGN_IDENTITY: Apple Development
PROVISIONING_PROFILE_SPECIFIER: dokoiko_develop
Release:
GCC_PREPROCESSOR_DEFINITIONS: "$(inherited)"
OTHER_SWIFT_FLAGS: "$(inherited)"
CODE_SIGN_IDENTITY: Apple Development
PROVISIONING_PROFILE_SPECIFIER: dokoiko_product
targets:
Dokoiko:
type: application
platform: iOS
sources:
- Dokoiko
- path: Carthage/Build/iOS/GoogleMaps.framework/Resources/GoogleMaps.bundle
optional: true
type: folder
# 自動生成するソースのパスを追加
# 以下はサンプル
## Mockoloで生成するファイル
# - path: "Foo/Generated/MockResults.swift"
# optional: true
# type: file
settings:
base:
INFOPLIST_FILE: Dokoiko/Info.plist
TARGETED_DEVICE_FAMILY: 1
preBuildScripts:
- script: |
if which mint >/dev/null; then
xcrun --sdk macosx mint run swiftymocky generate
else
echo "warning: swiftymocky not installed"
fi
name: Run Script (SwiftyMocky)
- script: |
if which mint >/dev/null; then
xcrun --sdk macosx mint run swiftformat swiftformat . --exclude Carthage,Pods --stripunusedargs closure-only --disable strongOutlets,trailingCommas
else
echo "warning: SwiftFormat not installed"
fi
name: Run Script (Swift Format)
postCompileScripts:
- script: |
if which mint >/dev/null; then
xcrun --sdk macosx mint run swiftlint swiftlint autocorrect --format
xcrun --sdk macosx mint run swiftlint swiftlint
else
echo "warning: Mint not installed, download from https://github.com/yonaskolb/Mint"
fi
name: Run Script (SwiftLint)
- script: |
if which mint >/dev/null; then
xcrun --sdk macosx mint run swiftgen
else
echo "failed SwiftGen Run Script"
fi
name: Run Script (SwiftGen)
- script: |
if which mint >/dev/null; then
xcrun --sdk macosx mint run carthage copy-frameworks
else
echo "failed SwiftGen Run Script"
fi
name: Run Script (Copy Framework)
inputFiles:
# arcive した後にAppStoreConnectにアップロードしようとした際に、以下のテスト用フレームワークを入れておくとエラーになる
#- $(SRCROOT)/Carthage/Build/RxBlocking.xcframework/ios-arm64_i386_x86_64-simulator/RxBlocking.framework
#- $(SRCROOT)/Carthage/Build/RxTest.xcframework/ios-arm64_i386_x86_64-simulator/RxTest.framework
- $(SRCROOT)/Carthage/Build/iOS/Realm.framework
- $(SRCROOT)/Carthage/Build/iOS/RealmSwift.framework
outputFiles:
#- $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxBlocking.framework
#- $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxTest.framework
- $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Realm.framework
- $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RealmSwift.framework
# 依存するライブラリなどを指定
dependencies:
- framework: Carthage/Build/RxSwift.xcframework
- framework: Carthage/Build/RxCocoa.xcframework
- framework: Carthage/Build/RxRelay.xcframework
- framework: Carthage/Build/Alamofire.xcframework
- framework: Carthage/Build/OHHTTPStubs.xcframework
# RealmはCarthageでXCFrameworkを作成できないため、frameworkで指定
#- framework: Carthage/Build/iOS/RealmSwift.framework
#- framework: Carthage/Build/iOS/Realm.framework
- framework: Carthage/Build/Lottie.xcframework
- framework: Carthage/Build/Kingfisher.xcframework
# GoogleMap導入(参考リンクメモ)
# https://nekowen.hatenablog.jp/entry/2020/09/01/133812
# https://stackoverflow.com/questions/8171164/ios-objc-class-cttelephonynetworkinfo-not-found
# https://developers.google.com/maps/documentation/ios-sdk/v3-client-migration#use-carthage
- carthage: GoogleMaps
embed: false
- carthage: GoogleMapsBase
embed: false
- carthage: GoogleMapsCore
embed: false
- carthage: Realm
embed: false
- carthage: RealmSwift
embed: false
- sdk: libc++.tbd
- sdk: libz.tbd
- sdk: CoreTelephony.framework
#- framework: Carthage/Build/RxBlocking.xcframework
#- framework: Carthage/Build/RxTest.xcframework
#- framework: Carthage/Build/SwiftyMocky.xcframework
#- framework: Carthage/Build/SwiftyPrototype.xcframework
DokoikoTests:
type: bundle.unit-test
platform: iOS
sources:
- DokoikoTests
# リソースを使用する場合はここにパスを追加する
# memo:
# ターゲット内に一つもリソースが存在しない場合、Build Phases の Copy Bundle Resources セクションが作成されず、
# swift ファイル以外のリソースの Target Membership にチェックを入れられなくなる。
# - Dokoiko/Resources
# - Dokoiko
settings:
base:
INFOPLIST_FILE: DokoikoTests/Info.plist
dependencies:
- target: Dokoiko
# memo: テスト用のフレームワークをメインターゲットで指定すると実行時にエラーが出るため、テストターゲットで指定している
# memo: Test Target には XCFramework が使えないため、シミュレータ用のframeworkのみ指定している
# https://dev.classmethod.jp/articles/build-carthage-use-xcframework/
- framework: Carthage/Build/RxBlocking.xcframework/ios-arm64_i386_x86_64-simulator/RxBlocking.framework
- framework: Carthage/Build/RxTest.xcframework/ios-arm64_i386_x86_64-simulator/RxTest.framework
- framework: Carthage/Build/SwiftyMocky.xcframework/ios-arm64_i386_x86_64-simulator/SwiftyMocky.framework
- framework: Carthage/Build/SwiftyPrototype.xcframework/ios-arm64_i386_x86_64-simulator/SwiftyPrototype.framework
DokoikoUITests:
type: bundle.ui-testing
platform: iOS
sources:
- DokoikoUITests
# - Dokoiko
settings:
base:
INFOPLIST_FILE: DokoikoUITests/Info.plist
dependencies:
- target: Dokoiko
- framework: Carthage/Build/RxBlocking.xcframework/ios-arm64_i386_x86_64-simulator/RxBlocking.framework
- framework: Carthage/Build/RxTest.xcframework/ios-arm64_i386_x86_64-simulator/RxTest.framework
- framework: Carthage/Build/SwiftyMocky.xcframework/ios-arm64_i386_x86_64-simulator/SwiftyMocky.framework
- framework: Carthage/Build/SwiftyPrototype.xcframework/ios-arm64_i386_x86_64-simulator/SwiftyPrototype.framework
# スキームの設定。一旦参考サイトをコピペで記載している
# https://qiita.com/uhooi/items/16a870eaae24b46103fb
schemes:
Dokoiko:
build:
targets:
Dokoiko: all
run:
config: Debug
test:
config: Debug
gatherCoverageData: true
coverageTargets:
- Dokoiko
targets:
- name: DokoikoTests
parallelizable: true
randomExecutionOrder: true
- name: DokoikoUITests
parallelizable: true
randomExecutionOrder: true
profile:
config: Release
analyze:
config: Debug
archive:
config: Release