Skip to content

Commit 21763e8

Browse files
cipolleschifacebook-github-bot
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. ## Changelog: [Internal] - Bump min IPHONEOS_DEPLOYMENT_TARGET for 3rd party pods Reviewed By: dmytrorykun Differential Revision: D49274837 fbshipit-source-id: 584d105c76d654daa2ecf5eb2f1b9381e70f567a
1 parent 0ab8b40 commit 21763e8

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
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 '13.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
@@ -281,6 +281,37 @@ def self.update_search_paths(installer)
281281
end
282282
end
283283

284+
def self.updateIphoneOSDeploymentTarget(installer)
285+
pod_to_update = Set.new([
286+
"boost",
287+
"CocoaAsyncSocket",
288+
"Flipper",
289+
"Flipper-DoubleConversion",
290+
"Flipper-Fmt",
291+
"Flipper-Boost-iOSX",
292+
"Flipper-Folly",
293+
"Flipper-Glog",
294+
"Flipper-PeerTalk",
295+
"FlipperKit",
296+
"fmt",
297+
"libevent",
298+
"OpenSSL-Universal",
299+
"RCT-Folly",
300+
"SocketRocket",
301+
"YogaKit"
302+
])
303+
304+
installer.target_installation_results.pod_target_installation_results
305+
.each do |pod_name, target_installation_result|
306+
unless pod_to_update.include?(pod_name)
307+
next
308+
end
309+
target_installation_result.native_target.build_configurations.each do |config|
310+
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
311+
end
312+
end
313+
end
314+
284315
# ========= #
285316
# Utilities #
286317
# ========= #

packages/react-native/scripts/react_native_pods.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
require_relative './cocoapods/new_architecture.rb'
1717
require_relative './cocoapods/local_podspec_patch.rb'
1818
require_relative './cocoapods/runtime.rb'
19+
require_relative './cocoapods/helpers.rb'
1920

2021
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
2122
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'
@@ -37,7 +38,7 @@
3738

3839

3940
def min_ios_version_supported
40-
return '13.4'
41+
return Helpers::Constants.min_ios_version_supported
4142
end
4243

4344
# This function returns the min supported OS versions supported by React Native
@@ -272,10 +273,12 @@ def react_native_post_install(
272273
ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled)
273274
ReactNativePodsUtils.apply_xcode_15_patch(installer)
274275
ReactNativePodsUtils.apply_ats_config(installer)
276+
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
275277

276278
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
277279
NewArchitectureHelper.modify_flags_for_new_architecture(installer, NewArchitectureHelper.new_arch_enabled)
278280

281+
279282
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
280283
end
281284

0 commit comments

Comments
 (0)