-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPodfile
61 lines (52 loc) · 1.67 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
platform :ios, '13.0'
use_frameworks!
pod 'Reachability', :inhibit_warnings => true
def ui_pods
pod 'lottie-ios', :inhibit_warnings => true
end
def common_pods
pod 'SwiftLint'
end
target 'DadJokes' do
ui_pods
common_pods
target 'DadJokesTests' do
inherit! :search_paths
end
end
post_install do |installer|
enable_strip(installer)
disable_bitcode(installer)
disable_armv7(installer)
# strip_valid_archs(installer)
end
# Works around CocoaPods behavior designed for static libraries.
# See https://github.com/CocoaPods/CocoaPods/issues/10277
def enable_strip(installer)
installer.pods_project.build_configurations.each do |build_configuration|
build_configuration.build_settings['STRIP_INSTALLED_PRODUCT'] = 'YES'
end
end
def disable_bitcode(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
def disable_armv7(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS'] = 'armv7'
end
end
end
def strip_valid_archs(installer)
Dir.glob('Pods/Target Support Files/**/*.xcconfig') do |xcconfig_path|
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub('VALID_ARCHS[sdk=iphoneos*] = arm64', '')
xcconfig_mod = xcconfig_mod.gsub('VALID_ARCHS[sdk=iphonesimulator*] = x86_64 arm64', '')
xcconfig_mod = xcconfig_mod.gsub('VALID_ARCHS[sdk=iphonesimulator*] = x86_64', '')
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
end