Skip to content

Commit b8b9b60

Browse files
cipolleschiTitozzz
authored andcommitted
Bump IPHONEOS_DEPLOYMENT_TARGET to 13.4 for 3rd party pods (#39478)
Summary: Pull Request resolved: #39478 When testing Xcode 15, we realized that a few pods we do not control directly have the IPHONEOS_DEPLOYMENT_TARGET set to old versions of iOS. We can update that setting to silence the warning with Cocoapods and this is what this script does. Notice that bumping that setting generated other warning as some APIs have been deprecated. [Internal] - Bump min IPHONEOS_DEPLOYMENT_TARGET for 3rd party pods Reviewed By: dmytrorykun Differential Revision: D49274837 fbshipit-source-id: 584d105c76d654daa2ecf5eb2f1b9381e70f567a
1 parent be89d2a commit b8b9b60

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

scripts/cocoapods/helpers.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ def self.find_codegen_file(path)
2626
return `find #{path} -type f \\( #{js_files} -or #{ts_files} \\)`.split("\n").sort()
2727
end
2828
end
29+
30+
module Helpers
31+
class Constants
32+
def self.min_ios_version_supported
33+
return '12.4'
34+
end
35+
end
36+
end

scripts/cocoapods/utils.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,34 @@ def self.fix_library_search_path(config)
178178
end
179179
end
180180

181+
def self.updateIphoneOSDeploymentTarget(installer)
182+
pod_to_update = Set.new([
183+
"boost",
184+
"CocoaAsyncSocket",
185+
"Flipper",
186+
"Flipper-DoubleConversion",
187+
"Flipper-Fmt",
188+
"Flipper-Boost-iOSX",
189+
"Flipper-Folly",
190+
"Flipper-Glog",
191+
"Flipper-PeerTalk",
192+
"FlipperKit",
193+
"fmt",
194+
"libevent",
195+
"OpenSSL-Universal",
196+
"RCT-Folly",
197+
"SocketRocket",
198+
"YogaKit"
199+
])
181200

201+
installer.target_installation_results.pod_target_installation_results
202+
.each do |pod_name, target_installation_result|
203+
unless pod_to_update.include?(pod_name)
204+
next
205+
end
206+
target_installation_result.native_target.build_configurations.each do |config|
207+
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
208+
end
209+
end
210+
end
182211
end

scripts/react_native_pods.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,21 @@
1515
require_relative './cocoapods/utils.rb'
1616
require_relative './cocoapods/new_architecture.rb'
1717
require_relative './cocoapods/local_podspec_patch.rb'
18+
require_relative './cocoapods/helpers.rb'
1819

1920
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
2021
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'
2122
$CODEGEN_MODULE_DIR = '.'
2223

2324
$START_TIME = Time.now.to_i
2425

26+
# This function returns the min supported OS versions supported by React Native
27+
# By using this function, you won't have to manually change your Podfile
28+
# when we change the minimum version supported by the framework.
29+
def min_ios_version_supported
30+
return Helpers::Constants.min_ios_version_supported
31+
end
32+
2533
# Function that setup all the react native dependencies
2634
2735
# Parameters
@@ -163,11 +171,13 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re
163171
ReactNativePodsUtils.fix_react_bridging_header_search_paths(installer)
164172
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
165173
ReactNativePodsUtils.apply_xcode_15_patch(installer)
174+
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
166175

167176
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
168177
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
169178
NewArchitectureHelper.modify_flags_for_new_architecture(installer, is_new_arch_enabled)
170179

180+
171181
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
172182
end
173183

0 commit comments

Comments
 (0)