-
Notifications
You must be signed in to change notification settings - Fork 79
/
Podfile
154 lines (135 loc) · 5.81 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
source 'https://cdn.cocoapods.org/'
# Allow using RNFirebase as static frameworks
# https://rnfirebase.io/#allow-ios-static-frameworks
# Otherwise we get the following error:
# `The 'Pods-celo' target has transitive dependencies that include statically linked binaries [...]`
$RNFirebaseAsStaticFramework = true
# Workaround for the following error:
# `The 'Pods-celo' target has transitive dependencies that include statically linked binaries [...]`
$static_framework = [
'react-native-flipper',
'FlipperKit',
'Flipper',
'Flipper-Folly',
'Flipper-DoubleConversion',
'Flipper-Glog',
'Flipper-PeerTalk',
'Flipper-RSocket',
'Flipper-Fmt',
]
require_relative "../node_modules/react-native/scripts/react_native_pods"
require_relative "../node_modules/@react-native-community/cli-platform-ios/native_modules"
require_relative "../node_modules/react-native-permissions/scripts/setup"
platform :ios, min_ios_version_supported
prepare_react_native_project!
# linkage = ENV['USE_FRAMEWORKS']
linkage="static"
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
setup_permissions(['Camera', 'AppTrackingTransparency', 'Contacts'])
target "celo" do
target "celoTests" do
inherit! :search_paths
end
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Note from Valora engineering:
# We're making use_frameworks! work with Flipper by using the following workaround:
# building all Flipper related pods as static libraries, linked against the main app.
# See $static_framework above
:flipper_configuration => FlipperConfiguration.enabled(
["Debug"],
{
# Use a specific version of Flipper-Glog which doesn't vendor glog as a dynamic library
# otherwise the main app fails to link (likely due to the 2 dynamic libraries with the same name)
# Flipper-Glog >= 0.3.7 uses a vendored dynamic library
# See https://github.com/CocoaPods/Specs/blob/86d45638f249b0cb766c8e674a98b1b504b1ac0e/Specs/2/7/2/Flipper-Glog/0.3.7/Flipper-Glog.podspec.json#L21
'Flipper-Glog' => '0.3.5',
# Use a specific version of Flipper which supports the Xcode 15.3
# toolchain: https://github.com/facebook/flipper/commit/b3dcdb87f930dbbc9dbacb53ad60996e0111e7d8
'Flipper' => '0.251.0',
}
),
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
# import OpenSSL after use_flipper! to avoid OpenSSL only being enabled for debug configurations
# Flipper-Folly requires this specific version of OpenSSL, so declaring it here to avoid duplicate versions in the podfile.lock.
pod 'OpenSSL-Universal', '1.1.1100', :configurations => ['Debug','Release']
end
target 'NotificationService' do
pod 'CTNotificationService'
pod 'CleverTap-iOS-SDK'
end
# Convert all permission pods into static libraries
# See https://github.com/react-native-community/react-native-permissions#workaround-for-use_frameworks-issues
pre_install do |installer|
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name) || pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["ENABLE_BITCODE"] = "NO"
end
# Fix for Xcode 14, see https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1201464693
# Can be removed once we upgrade CocoaPods to >= 1.12
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_SIGNING_ALLOWED'] = 'NO'
end
end
end
projects = installer.aggregate_targets
.map{ |t| t.user_project }
.uniq{ |p| p.path }
.push(installer.pods_project)
# This block is needed for preserving the EXCLUDED_ARCHS setting on M1 machines
projects.each do |project|
project.build_configurations.each do |config|
# Needed for now as Xcode 12 now tries to build/link both arm64 and x86_64 slices for the simulator
# but some of our prebuilt deps don't support this
# See:
# - https://stackoverflow.com/a/63955114/158525
# - https://github.com/facebook/react-native/issues/29984
# - https://apontious.com/2020/08/23/arm-wrestling-your-ios-simulator-builds/
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64 "
end
project.save()
end
# Include env xccconfig generated by React Native Config
installer.aggregate_targets.each do |target|
target.user_build_configurations.each_key do |key|
cocoapods_xcconfig = target.xcconfig_path(key)
rnconfig_xcconfig = target.client_root + "env.xcconfig"
File.open(cocoapods_xcconfig, 'a') do |f|
f.write <<~EOF
// Env config generated by React Native Config
#include? "#{rnconfig_xcconfig.relative_path_from(cocoapods_xcconfig.dirname)}"
EOF
end
end
end
end