forked from woocommerce/woocommerce-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPodfile
315 lines (265 loc) · 8.21 KB
/
Podfile
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
require 'cocoapods-catalyst-support'
# For security reasons, please always keep the wordpress-mobile source first and the CDN second.
# For more info, see https://github.com/wordpress-mobile/cocoapods-specs#source-order-and-security-considerations
install! 'cocoapods', warn_for_multiple_pod_sources: false
source 'https://github.com/wordpress-mobile/cocoapods-specs.git'
source 'https://cdn.cocoapods.org/'
raise 'Please run CocoaPods via `bundle exec`' unless %w[BUNDLE_BIN_PATH BUNDLE_GEMFILE].any? { |k| ENV.key?(k) }
inhibit_all_warnings!
use_frameworks! # Defaulting to use_frameworks! See pre_install hook below for static linking.
use_modular_headers!
app_ios_deployment_target = Gem::Version.new('14.0')
platform :ios, app_ios_deployment_target.version
workspace 'WooCommerce.xcworkspace'
## Pods shared between all the targets
## =====================================
##
def aztec
pod 'WordPress-Editor-iOS', '~> 1.11.0'
end
# Main Target!
# ============
#
target 'WooCommerce' do
project 'WooCommerce/WooCommerce.xcodeproj'
# Automattic Libraries
# ====================
#
#pod 'Automattic-Tracks-iOS', :git => 'https://github.com/Automattic/Automattic-Tracks-iOS.git', :branch => 'add/build-configuration'
pod 'Automattic-Tracks-iOS', '~> 0.9.1'
pod 'Gridicons', '~> 1.2.0'
# To allow pod to pick up beta versions use -beta. E.g., 1.1.7-beta.1
pod 'WordPressAuthenticator', '~> 1.43.1'
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => ''
# pod 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'
pod 'WordPressShared', '~> 1.15'
pod 'WordPressUI', '~> 1.12.4'
# pod 'WordPressUI', :git => 'https://github.com/wordpress-mobile/WordPressUI-iOS.git', :branch => ''
aztec
pod 'WPMediaPicker', '~> 1.8.1'
# External Libraries
# ==================
#
pod 'Alamofire', '~> 4.8'
pod 'KeychainAccess', '~> 3.2'
pod 'CocoaLumberjack', '~> 3.5'
pod 'CocoaLumberjack/Swift', '~> 3.5'
pod 'XLPagerTabStrip', '~> 9.0'
pod 'Charts', '~> 3.6.0'
pod 'ZendeskSupportSDK', '~> 5.0'
pod 'StripeTerminal', '~> 2.6'
pod 'Kingfisher', '~> 6.0.0'
pod 'Wormholy', '~> 1.6.5', configurations: ['Debug']
# Unit Tests
# ==========
#
target 'WooCommerceTests' do
inherit! :search_paths
end
end
# Yosemite Layer:
# ===============
#
def yosemite_pods
pod 'Alamofire', '~> 4.8'
pod 'StripeTerminal', '~> 2.6'
pod 'CocoaLumberjack', '~> 3.5'
pod 'CocoaLumberjack/Swift', '~> 3.5'
# To allow pod to pick up beta versions use -beta. E.g., 1.1.7-beta.1
pod 'WordPressKit', '~> 4.46.0'
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => ''
aztec
end
# Yosemite Target:
# ================
#
target 'Yosemite' do
project 'Yosemite/Yosemite.xcodeproj'
yosemite_pods
end
# Unit Tests
# ==========
#
target 'YosemiteTests' do
project 'Yosemite/Yosemite.xcodeproj'
yosemite_pods
end
# Networking Layer:
# =================
#
def networking_pods
pod 'Alamofire', '~> 4.8'
pod 'CocoaLumberjack', '~> 3.5'
pod 'CocoaLumberjack/Swift', '~> 3.5'
pod 'Sourcery', '~> 1.0.3', configuration: 'Debug'
# Used for HTML parsing
aztec
end
# Networking Target:
# ==================
#
target 'Networking' do
project 'Networking/Networking.xcodeproj'
networking_pods
end
# Unit Tests
# ==========
#
target 'NetworkingTests' do
project 'Networking/Networking.xcodeproj'
networking_pods
# Including `yosemite_pods` because `Fakes.framework` has a dependency `Yosemite` while `Networking` does not.
yosemite_pods
end
# Storage Layer:
# ==============
#
def storage_pods
pod 'CocoaLumberjack', '~> 3.5'
pod 'CocoaLumberjack/Swift', '~> 3.5'
end
# Storage Target:
# ===============
#
target 'Storage' do
project 'Storage/Storage.xcodeproj'
storage_pods
end
# Unit Tests
# ==========
#
target 'StorageTests' do
project 'Storage/Storage.xcodeproj'
storage_pods
end
# Hardware Layer:
# =================
#
def hardware_pods
pod 'StripeTerminal', '~> 2.6'
pod 'CocoaLumberjack', '~> 3.5'
pod 'CocoaLumberjack/Swift', '~> 3.5'
end
# Hardware Target:
# ==================
#
target 'Hardware' do
project 'Hardware/Hardware.xcodeproj'
hardware_pods
end
# Unit Tests
# ==========
#
target 'HardwareTests' do
project 'Hardware/Hardware.xcodeproj'
hardware_pods
end
# SampleReceiptPrinter Target:
# ==================
#
target 'SampleReceiptPrinter' do
project 'Hardware/Hardware.xcodeproj'
hardware_pods
end
# Experiments Layer:
# ==================
#
def experiments_pods
pod 'Automattic-Tracks-iOS', '~> 0.9.1'
pod 'CocoaLumberjack', '~> 3.5'
pod 'CocoaLumberjack/Swift', '~> 3.5'
end
# Experiments Target:
# ===================
#
target 'Experiments' do
project 'Experiments/Experiments.xcodeproj'
experiments_pods
end
# Unit Tests
# ==========
#
target 'ExperimentsTests' do
project 'Experiments/Experiments.xcodeproj'
experiments_pods
end
# Workarounds:
# ============
#
# Static Frameworks:
# ============
#
# Make all pods that are not shared across multiple targets into static frameworks by overriding the static_framework? function to return true
# Linking the shared frameworks statically would lead to duplicate symbols
# A future version of CocoaPods may make this easier to do. See https://github.com/CocoaPods/CocoaPods/issues/7428
shared_targets = %w[Storage Networking Yosemite Hardware]
# Statically linking Sentry results in a conflict with `NSDictionary.objectAtKeyPath`, but dynamically
# linking it resolves this.
dynamic_pods = ['Sentry']
pre_install do |installer|
static = []
dynamic = []
installer.pod_targets.each do |pod|
# If this pod is a dependency of one of our shared targets or its explicitly excluded, it must be linked dynamically
if pod.target_definitions.any? { |t| shared_targets.include? t.name } || dynamic_pods.include?(pod.name)
dynamic << pod
next
end
static << pod
def pod.static_framework?
true
end
end
puts "Installing #{static.count} pods as static frameworks"
puts "Installing #{dynamic.count} pods as dynamic frameworks"
# Force CocoaLumberjack Swift version
installer.analysis_result.specifications.each do |s|
s.swift_version = '5.0' if s.name == 'CocoaLumberjack'
end
end
# Configure your macCatalyst dependencies
catalyst_configuration do
# Uncomment the next line for a verbose output
# verbose!
# ios '<pod_name>' # This dependency will only be available for iOS
ios 'StripeTerminal'
ios 'ZendeskSupportSDK'
# macos '<pod_name>' # This dependency will only be available for macOS
end
post_install do |installer|
installer.configure_catalyst
# Workaround: Drop 32 Bit Architectures
# =====================================
#
installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
configuration.build_settings['VALID_ARCHS'] = '$(ARCHS_STANDARD_64_BIT)'
end
# Let Pods targets inherit deployment target from the app
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/4859
# =====================================
#
installer.pods_project.targets.each do |target|
# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = '-'
end
end
target.build_configurations.each do |configuration|
pod_ios_deployment_target = Gem::Version.new(configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
if pod_ios_deployment_target <= app_ios_deployment_target
configuration.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
# Flag Alpha builds for Tracks
# ============================
installer.pods_project.targets.each do |target|
next unless target.name == "Automattic-Tracks-iOS"
target.build_configurations.each do |config|
next unless config.name == "Release-Alpha"
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'ALPHA=1']
end
end
end