forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPodfile
128 lines (110 loc) · 3.98 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
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
# Set the type of Mapbox SDK to use
# This value is used by $RNMapboxMaps
$RNMapboxMapsImpl = 'mapbox'
def node_require(script)
# Resolve script with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')
# Our min supported iOS version is higher than the default (min_ios_version_supported) to support libraires such as Airship
platform :ios, 13.4
prepare_react_native_project!
setup_permissions([
'Camera',
'LocationAccuracy',
'LocationAlways',
'LocationWhenInUse'
])
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled(['DebugProduction', 'DebugDevelopment', 'DebugAdHoc'])
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
# Force pods to match minimum iOS version for React Native
# Fixes build issue on Xcode Cloud where some pods
# Use iOS 12 calls despite being set as iOS 11
def __apply_Xcode_14_3_RC_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
current_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
minimum_target = min_ios_version_supported
if current_target.to_f < minimum_target.to_f
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = minimum_target
end
end
end
end
# Configure Mapbox before installing dependencies
pre_install do |installer|
$RNMapboxMaps.pre_install(installer)
end
target 'NewExpensify' do
use_expo_modules!
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
permissions_path = '../node_modules/react-native-permissions/ios'
project 'NewExpensify',
'DebugDevelopment' => :debug,
'DebugAdHoc' => :debug,
'DebugProduction' => :debug,
'ReleaseDevelopment' => :release,
'ReleaseAdHoc' => :release,
'ReleaseProduction' => :release
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'NewExpensifyTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
# Configure Mapbox after installation
$RNMapboxMaps.post_install(installer)
# https://github.com/facebook/react-native/blob/main/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
__apply_Xcode_14_3_RC_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
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
end
end
target 'NotificationServiceExtension' do
pod 'AirshipServiceExtension'
end