Skip to content

Commit f6107b6

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 7399bbb commit f6107b6

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

scripts/cocoapods/helpers.rb

+8
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

scripts/cocoapods/utils.rb

+31
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,35 @@ def self.detect_use_frameworks(target_definition)
197197
ENV['USE_FRAMEWORKS'] = nil
198198
end
199199
end
200+
201+
def self.updateIphoneOSDeploymentTarget(installer)
202+
pod_to_update = Set.new([
203+
"boost",
204+
"CocoaAsyncSocket",
205+
"Flipper",
206+
"Flipper-DoubleConversion",
207+
"Flipper-Fmt",
208+
"Flipper-Boost-iOSX",
209+
"Flipper-Folly",
210+
"Flipper-Glog",
211+
"Flipper-PeerTalk",
212+
"FlipperKit",
213+
"fmt",
214+
"libevent",
215+
"OpenSSL-Universal",
216+
"RCT-Folly",
217+
"SocketRocket",
218+
"YogaKit"
219+
])
220+
221+
installer.target_installation_results.pod_target_installation_results
222+
.each do |pod_name, target_installation_result|
223+
unless pod_to_update.include?(pod_name)
224+
next
225+
end
226+
target_installation_result.native_target.build_configurations.each do |config|
227+
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
228+
end
229+
end
230+
end
200231
end

scripts/react_native_pods.rb

+6-3
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'
@@ -23,11 +24,11 @@
2324

2425
$START_TIME = Time.now.to_i
2526

26-
# This function returns the min iOS version supported by React Native
27-
# By using this function, you won't have to manualy change your Podfile
27+
# This function returns the min supported OS versions supported by React Native
28+
# By using this function, you won't have to manually change your Podfile
2829
# when we change the minimum version supported by the framework.
2930
def min_ios_version_supported
30-
return '12.4'
31+
return Helpers::Constants.min_ios_version_supported
3132
end
3233

3334
# This function prepares the project for React Native, before processing
@@ -224,11 +225,13 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re
224225
ReactNativePodsUtils.fix_library_search_paths(installer)
225226
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
226227
ReactNativePodsUtils.apply_xcode_15_patch(installer)
228+
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
227229

228230
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
229231
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
230232
NewArchitectureHelper.modify_flags_for_new_architecture(installer, is_new_arch_enabled)
231233

234+
232235
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
233236
end
234237

0 commit comments

Comments
 (0)