Skip to content

Commit a5e110a

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 f6fd6b8 commit a5e110a

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

packages/react-native/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

packages/react-native/scripts/cocoapods/utils.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,37 @@ def self.update_search_paths(installer)
232232
end
233233
end
234234

235+
def self.updateIphoneOSDeploymentTarget(installer)
236+
pod_to_update = Set.new([
237+
"boost",
238+
"CocoaAsyncSocket",
239+
"Flipper",
240+
"Flipper-DoubleConversion",
241+
"Flipper-Fmt",
242+
"Flipper-Boost-iOSX",
243+
"Flipper-Folly",
244+
"Flipper-Glog",
245+
"Flipper-PeerTalk",
246+
"FlipperKit",
247+
"fmt",
248+
"libevent",
249+
"OpenSSL-Universal",
250+
"RCT-Folly",
251+
"SocketRocket",
252+
"YogaKit"
253+
])
254+
255+
installer.target_installation_results.pod_target_installation_results
256+
.each do |pod_name, target_installation_result|
257+
unless pod_to_update.include?(pod_name)
258+
next
259+
end
260+
target_installation_result.native_target.build_configurations.each do |config|
261+
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
262+
end
263+
end
264+
end
265+
235266
# ========= #
236267
# Utilities #
237268
# ========= #

packages/react-native/scripts/react_native_pods.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
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'
@@ -34,11 +35,12 @@
3435
{paths: [process.argv[1]]},
3536
)', __dir__]).strip
3637

37-
# This function returns the min iOS version supported by React Native
38+
39+
# This function returns the min supported OS versions supported by React Native
3840
# By using this function, you won't have to manually change your Podfile
3941
# when we change the minimum version supported by the framework.
4042
def min_ios_version_supported
41-
return '12.4'
43+
return Helpers::Constants.min_ios_version_supported
4244
end
4345

4446
# This function prepares the project for React Native, before processing
@@ -245,11 +247,13 @@ def react_native_post_install(
245247
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
246248
ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled)
247249
ReactNativePodsUtils.apply_xcode_15_patch(installer)
250+
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
248251

249252
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
250253
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
251254
NewArchitectureHelper.modify_flags_for_new_architecture(installer, is_new_arch_enabled)
252255

256+
253257
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
254258
end
255259

0 commit comments

Comments
 (0)