diff --git a/scripts/cocoapods/__tests__/codegen_utils-test.rb b/scripts/cocoapods/__tests__/codegen_utils-test.rb index cdceb5d8510d8e..3139d4b746d679 100644 --- a/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -431,6 +431,14 @@ def testCleanUpCodegenFolder_whenFolderExists_deleteItAndSetCleanupDone private + # mocking the min_ios_version_supported function + # as it is not possible to require the original react_native_pod + # without incurring in circular deps + # TODO: move `min_ios_version_supported` to utils.rb + def min_ios_version_supported + return '12.4' + end + def get_podspec_no_fabric_no_script spec = { 'name' => "React-Codegen", @@ -443,7 +451,7 @@ def get_podspec_no_fabric_no_script 'source' => { :git => '' }, 'header_mappings_dir' => './', 'platforms' => { - 'ios' => '11.0', + 'ios' => min_ios_version_supported, }, 'source_files' => "**/*.{h,mm,cpp}", 'pod_target_xcconfig' => { "HEADER_SEARCH_PATHS" => diff --git a/scripts/cocoapods/codegen_utils.rb b/scripts/cocoapods/codegen_utils.rb index 406e9936d236f8..a6e050245b24a7 100644 --- a/scripts/cocoapods/codegen_utils.rb +++ b/scripts/cocoapods/codegen_utils.rb @@ -60,6 +60,13 @@ def generate_react_codegen_podspec!(spec, codegen_output_dir) @@REACT_CODEGEN_PODSPEC_GENERATED = true end + # This function returns the min iOS version supported by React Native + # By using this function, you won't have to manually change your Podfile + # when we change the minimum version supported by the framework. + def min_ios_version_supported + return '12.4' + end + # It generates the podspec object that represents the `React-Codegen.podspec` file # # Parameters @@ -84,7 +91,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa 'source' => { :git => '' }, 'header_mappings_dir' => './', 'platforms' => { - 'ios' => '11.0', + 'ios' => min_ios_version_supported, }, 'source_files' => "**/*.{h,mm,cpp}", 'pod_target_xcconfig' => { "HEADER_SEARCH_PATHS" =>