-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathPodfile
More file actions
100 lines (85 loc) · 3.66 KB
/
Podfile
File metadata and controls
100 lines (85 loc) · 3.66 KB
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
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
react_native_path = File.dirname(
Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/package.json",
{paths: [process.argv[1]]},
)', __dir__]).strip,
)
fmt_podspec_path = File.join(react_native_path, 'third-party-podspecs', 'fmt.podspec')
rct_folly_podspec_path = File.join(react_native_path, 'third-party-podspecs', 'RCT-Folly.podspec')
fmt_podspec = File.read(fmt_podspec_path)
fmt_podspec = fmt_podspec.gsub('spec.version = "11.0.2"', 'spec.version = "12.1.0"')
fmt_podspec = fmt_podspec.gsub(':tag => "11.0.2"', ':tag => "12.1.0"')
fmt_podspec = fmt_podspec.gsub(
'"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don\'t control this library',
"\"GCC_WARN_INHIBIT_ALL_WARNINGS\" => \"YES\", \"OTHER_CPLUSPLUSFLAGS\" => \"$(inherited) -DFMT_USE_CONSTEVAL=0\" # Disable warnings because we don't control this library",
)
File.write(fmt_podspec_path, fmt_podspec)
rct_folly_podspec = File.read(rct_folly_podspec_path)
rct_folly_podspec = rct_folly_podspec.gsub('spec.dependency "fmt", "11.0.2"', 'spec.dependency "fmt", "12.1.0"')
rct_folly_podspec = rct_folly_podspec.gsub(
'"GCC_WARN_INHIBIT_ALL_WARNINGS" => "YES" # Disable warnings because we don\'t control this library',
"\"GCC_WARN_INHIBIT_ALL_WARNINGS\" => \"YES\", \"OTHER_CPLUSPLUSFLAGS\" => \"$(inherited) -DFMT_USE_CONSTEVAL=0\" # Disable warnings because we don't control this library",
)
File.write(rct_folly_podspec_path, rct_folly_podspec)
platform :ios, min_ios_version_supported
prepare_react_native_project!
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
target 'SampleApp' do
config = use_native_modules!
# Added for op-sqlite library - https://ospfranco.notion.site/Installation-93044890aa3d4d14b6c525ba4ba8686f#acdc7a6723234f8b8440acb1ae0e7d87
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name.eql?('op-sqlite')
def pod.build_type
Pod::BuildType.static_library
end
end
end
end
# Beginning with firebase-ios-sdk v9+ (react-native-firebase v15+) we must tell CocoaPods to use frameworks.
# https://rnfirebase.io/#altering-cocoapods-to-use-frameworks
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'SampleAppTests' do
inherit! :complete
# Pods for testing
end
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'Firebase/AppDistribution'
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
installer.pods_project.targets.each do |target|
next unless ['fmt', 'RCT-Folly'].include?(target.name)
target.build_configurations.each do |config|
flags = Array(config.build_settings['OTHER_CPLUSPLUSFLAGS'] || '$(inherited)')
unless flags.include?('-DFMT_USE_CONSTEVAL=0')
flags << '-DFMT_USE_CONSTEVAL=0'
end
config.build_settings['OTHER_CPLUSPLUSFLAGS'] = flags
end
end
end
end