forked from tangem/tangem-app-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Podfile
285 lines (235 loc) · 8.75 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
# Uncomment the next line to define a global platform for your project
platform :ios, '15.0'
# Debug Xcode configurations
debug_configuration = 'Debug(production)'
debug_alpha_configuration = 'Debug(alpha)'
debug_beta_configuration = 'Debug(beta)'
# Release Xcode configurations
release_configuration = 'Release(production)'
release_alpha_configuration = 'Release(alpha)'
release_beta_configuration = 'Release(beta)'
project 'TangemApp.xcodeproj',
debug_configuration => :debug,
debug_alpha_configuration => :debug,
debug_beta_configuration => :debug,
release_configuration => :release,
release_alpha_configuration => :release,
release_beta_configuration => :release
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
inhibit_all_warnings!
def tangem_sdk_pod
pod 'TangemSdk', :git => 'https://github.com/Tangem/tangem-sdk-ios.git', :tag => 'develop-301'
#pod 'TangemSdk', :path => '../tangem-sdk-ios'
end
def blockchain_sdk_pods
# 'TangemWalletCore' dependency must be added via SPM
pod 'BlockchainSdk', :git => 'https://github.com/tangem/blockchain-sdk-swift.git', :tag => 'develop-646'
#pod 'BlockchainSdk', :path => '../blockchain-sdk-swift'
pod 'Solana.Swift', :git => 'https://github.com/tangem/Solana.Swift', :tag => '1.2.0-tangem10'
#pod 'Solana.Swift', :path => '../Solana.Swift'
pod 'BinanceChain', :git => 'https://github.com/tangem/swiftbinancechain.git', :tag => '0.0.11'
#pod 'BinanceChain', :path => '../SwiftBinanceChain'
pod 'BitcoinCore.swift', :git => 'https://github.com/tangem/bitcoincore.git', :tag => '0.0.20'
#pod 'BitcoinCore.swift', :path => '../bitcoincore'
pod 'SwiftyJSON', :git => 'https://github.com/tangem/SwiftyJSON.git', :tag => '5.0.1-tangem1'
end
target 'Tangem' do
blockchain_sdk_pods
tangem_sdk_pod
# Pods for Tangem
pod 'Moya'
pod 'WalletConnectSwiftV2', :git => 'https://github.com/WalletConnect/WalletConnectSwiftV2', :tag => '1.18.7'
pod 'Kingfisher', '~> 7.11.0'
# Helpers
pod 'BlockiesSwift', '~> 0.1.2'
pod 'CombineExt', '~> 1.8.0'
# Debug and development pods
pod 'GDPerformanceView-Swift', '~> 2.1', :configurations => [
debug_configuration,
debug_alpha_configuration,
debug_beta_configuration,
release_alpha_configuration,
release_beta_configuration,
]
# Support chat
#pod 'SPRMessengerClient', :git => 'https://github.com/tangem/SPRMessengerClient-binaries-ios.git', :tag => 'sprinklr-3.6.2-tangem1'
# Analytics
pod 'AmplitudeSwift', '1.6.2'
pod 'Firebase/Crashlytics', '10.29.0'
pod 'Firebase/Analytics', '10.29.0'
# Push notifications
pod 'Firebase/Messaging', '10.29.0'
target 'TangemTests' do
inherit! :search_paths
# Pods for testing
end
target 'TangemUITests' do
# Pods for testing
end
end
target 'TangemExpress' do
blockchain_sdk_pods
pod 'Moya'
target 'TangemExpressTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'TangemVisa' do
blockchain_sdk_pods
pod 'Moya'
target 'TangemVisaTests' do
blockchain_sdk_pods
end
end
target 'TangemStaking' do
blockchain_sdk_pods
pod 'Moya'
target 'TangemStakingTests' do
inherit! :search_paths
end
end
target 'TangemFoundation' do
pod 'Moya'
target 'TangemFoundationTests' do
inherit! :search_paths
end
end
pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
if config.name.downcase.include?("debug")
config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '0'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
config.build_settings['ENABLE_TESTABILITY'] = 'YES'
config.build_settings['SWIFT_COMPILATION_MODE'] = 'Incremental'
end
# Fix warnings on Xcode 15 https://indiestack.com/2023/10/xcode-15-duplicate-library-linker-warnings/
config.build_settings['OTHER_LDFLAGS'] ||= ['$(inherited)']
config.build_settings['OTHER_LDFLAGS'] << '-Wl,-no_warn_duplicate_libraries'
config.build_settings['DEAD_CODE_STRIPPING'] = 'YES'
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.5'
end
end
# ============ SPM <-> CocoaPods interop ============
# `Hedera` SPM package for `BlockchainSdk` pod
add_spm_package_to_target(
installer.pods_project,
"BlockchainSdk",
"https://github.com/tangem/hedera-sdk-swift.git",
"Hedera",
{ :kind => "exactVersion", :version => "0.26.0-tangem3" }
)
# `CryptoSwift` SPM package for `BlockchainSdk` pod
add_spm_package_to_target(
installer.pods_project,
"BlockchainSdk",
"https://github.com/krzyzanowskim/CryptoSwift.git",
"CryptoSwift",
{ :kind => "upToNextMajorVersion", :minimumVersion => "1.8.0" }
)
# `Wallet Core binaries` SPM package for `BlockchainSdk` pod
add_spm_package_to_target(
installer.pods_project,
"BlockchainSdk",
"https://github.com/tangem/wallet-core-binaries-ios.git",
"TangemWalletCoreBinariesWrapper",
{ :kind => "exactVersion", :version => "4.0.21-tangem6" }
)
# `SwiftProtobuf` SPM package for `BlockchainSdk` pod
add_spm_package_to_target(
installer.pods_project,
"BlockchainSdk",
"https://github.com/tangem/swift-protobuf-binaries.git",
"SwiftProtobuf",
{ :kind => "exactVersion", :version => "1.25.2-tangem1" }
)
# `TonSwift` SPM package for `BlockchainSdk` pod
add_spm_package_to_target(
installer.pods_project,
"BlockchainSdk",
"https://github.com/tangem/ton-swift.git",
"TonSwift",
{ :kind => "exactVersion", :version => "1.0.10-tangem1" }
)
# `ScaleCodec` SPM package for `BlockchainSdk` pod
add_spm_package_to_target(
installer.pods_project,
"BlockchainSdk",
"https://github.com/tesseract-one/ScaleCodec.swift",
"ScaleCodec",
{ :kind => "exactVersion", :version => "0.2.1" }
)
# `SwiftProtobuf` SPM package for `BinanceChain` pod
add_spm_package_to_target(
installer.pods_project,
"BinanceChain",
"https://github.com/tangem/swift-protobuf-binaries.git",
"SwiftProtobuf",
{ :kind => "exactVersion", :version => "1.25.2-tangem1" }
)
# `secp256k1.swift` SPM package for `Solana.Swift` pod
add_spm_package_to_target(
installer.pods_project,
"Solana.Swift",
"https://github.com/GigaBitcoin/secp256k1.swift.git",
"secp256k1",
{ :kind => "upToNextMinorVersion", :minimumVersion => "0.12.0" }
)
# `TweetNacl` SPM package for `Solana.Swift` pod
add_spm_package_to_target(
installer.pods_project,
"Solana.Swift",
"https://github.com/bitmark-inc/tweetnacl-swiftwrap.git",
"TweetNacl",
{ :kind => "exactVersion", :version => "1.1.0" }
)
end
# Adds given SPM package as a dependency to a specific target in the `Pods` project.
# TODO: Extract this logic to a dedicated CocoaPods plugin (IOS-5855)
#
# Valid values for the `requirement` parameter are:
# - `{ :kind => "upToNextMajorVersion", :minimumVersion => "1.0.0" }`
# - `{ :kind => "upToNextMinorVersion", :minimumVersion => "1.0.0" }`
# - `{ :kind => "exactVersion", :version => "1.0.0" }`
# - `{ :kind => "versionRange", :minimumVersion => "1.0.0", :maximumVersion => "2.0.0" }`
# - `{ :kind => "branch", :branch => "some-feature-branch" }`
# - `{ :kind => "revision", :revision => "4a9b230f2b18e1798abbba2488293844bf62b33f" }`
def add_spm_package_to_target(project, target_name, url, product_name, requirement)
project.targets.each do |target|
if target.name == target_name
pkg = project.new(Xcodeproj::Project::Object::XCRemoteSwiftPackageReference)
pkg.repositoryURL = url
pkg.requirement = requirement
ref = project.new(Xcodeproj::Project::Object::XCSwiftPackageProductDependency)
ref.package = pkg
ref.product_name = product_name
target.package_product_dependencies << ref
project_already_has_this_pkg = false
project.root_object.package_references.each do |existing_ref|
if existing_ref.display_name.downcase.eql?(url.downcase)
project_already_has_this_pkg = true
break
end
end
unless project_already_has_this_pkg
project.root_object.package_references << pkg
end
target.build_configurations.each do |config|
config.build_settings['SWIFT_INCLUDE_PATHS'] = '$(inherited) ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
end
end
end
project.save
end