From 79dd4a132c697859fc2888e4cb63850d3b5bf366 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 21 Sep 2023 19:14:34 -0700 Subject: [PATCH 1/3] updateIphoneOSDeploymentTarget -> updateOSDeploymentTarget (#39570) Summary: While merging new commits into React Native macOS, I noticed https://github.com/facebook/react-native/pull/39478/ I would like to also set `MACOS_DEPLOYMENT_TARGET` in our fork, and thought this slight rename would be something I can do upstream [Internal] - updateIphoneOSDeploymentTarget -> updateOSDeploymentTarget Pull Request resolved: https://github.com/facebook/react-native/pull/39570 Test Plan: CI should pass Reviewed By: NickGerleman Differential Revision: D49514693 Pulled By: ryancat fbshipit-source-id: b4dafb1f9736d2977510712652cb8097263c489d --- packages/react-native/scripts/cocoapods/utils.rb | 2 +- packages/react-native/scripts/react_native_pods.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index d4bf3a09478b70..0d3befb0c37d82 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -247,7 +247,7 @@ def self.update_search_paths(installer) end end - def self.updateIphoneOSDeploymentTarget(installer) + def self.updateOSDeploymentTarget(installer) pod_to_update = Set.new([ "boost", "CocoaAsyncSocket", diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index a16a8f6b8b0d86..080b6fc622b743 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -247,7 +247,7 @@ def react_native_post_install( ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path) ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled) ReactNativePodsUtils.apply_xcode_15_patch(installer) - ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer) + ReactNativePodsUtils.updateOSDeploymentTarget(installer) NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer) is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1" From b77bf1849c2a2e5db475caa339015350f2c31608 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 7 Sep 2023 03:16:23 -0700 Subject: [PATCH 2/3] min_ios_version_supported -> min_supported_versions (#39310) Summary: One of the most common diffs we have in React Native macOS is simply extending the `platforms` key Inside every pod spec to include macOS. React Native tvOS does the same to add tvOS. In the future, React Native may support visionOS, at which point we do the same thing again. Let's define a `min_supported_versions` hash that can be overridden at one place that is extensible to more platforms, instead of just specifying `min_ios_version_supported`. Note: In doing this change, I have set it that `React-Hermes.podspec` doesn't build for macOS anymore. I think this is safe, since anyone using Hermes on macOS was probably using React Native macOS where we already have a diff to add macOS back? [IOS] [CHANGED] - Add min_supported_versions helper to cocoa pods scripts Pull Request resolved: https://github.com/facebook/react-native/pull/39310 Test Plan: CI should pass. Reviewed By: NickGerleman Differential Revision: D49014109 Pulled By: dmytrorykun fbshipit-source-id: d44fc7b750c70cc263a2c89502c022a0db9a4771 --- .../ActionSheetIOS/React-RCTActionSheet.podspec | 2 +- .../Libraries/AppDelegate/React-RCTAppDelegate.podspec | 2 +- .../react-native/Libraries/Blob/React-RCTBlob.podspec | 2 +- .../Libraries/FBLazyVector/FBLazyVector.podspec | 2 +- .../react-native/Libraries/Image/React-RCTImage.podspec | 2 +- .../Libraries/LinkingIOS/React-RCTLinking.podspec | 2 +- .../Libraries/NativeAnimation/React-RCTAnimation.podspec | 2 +- .../Libraries/Network/React-RCTNetwork.podspec | 2 +- .../React-RCTPushNotification.podspec | 2 +- .../Libraries/RCTRequired/RCTRequired.podspec | 2 +- .../Libraries/Settings/React-RCTSettings.podspec | 2 +- .../react-native/Libraries/Text/React-RCTText.podspec | 2 +- .../Libraries/TypeSafety/RCTTypeSafety.podspec | 2 +- .../Libraries/Vibration/React-RCTVibration.podspec | 2 +- packages/react-native/React-Core.podspec | 2 +- packages/react-native/React.podspec | 2 +- .../React/CoreModules/React-CoreModules.podspec | 2 +- .../React/FBReactNativeSpec/FBReactNativeSpec.podspec | 2 +- packages/react-native/React/React-RCTFabric.podspec | 2 +- packages/react-native/ReactCommon/React-Fabric.podspec | 2 +- packages/react-native/ReactCommon/React-rncore.podspec | 2 +- packages/react-native/ReactCommon/ReactCommon.podspec | 2 +- .../ReactCommon/callinvoker/React-callinvoker.podspec | 2 +- .../ReactCommon/cxxreact/React-cxxreact.podspec | 2 +- .../react-native/ReactCommon/hermes/React-hermes.podspec | 2 +- packages/react-native/ReactCommon/jsc/React-jsc.podspec | 2 +- packages/react-native/ReactCommon/jsi/React-jsi.podspec | 2 +- .../ReactCommon/jsiexecutor/React-jsiexecutor.podspec | 2 +- .../ReactCommon/jsinspector/React-jsinspector.podspec | 2 +- .../react-native/ReactCommon/logger/React-logger.podspec | 2 +- .../ReactCommon/react/debug/React-debug.podspec | 2 +- .../core/platform/ios/React-NativeModulesApple.podspec | 2 +- .../nativemodule/samples/ReactCommon-Samples.podspec | 2 +- .../react/renderer/graphics/React-graphics.podspec | 2 +- .../imagemanager/platform/ios/React-ImageManager.podspec | 2 +- .../runtimescheduler/React-runtimescheduler.podspec | 2 +- .../ReactCommon/react/utils/React-utils.podspec | 2 +- .../ReactCommon/reactperflogger/React-perflogger.podspec | 2 +- .../runtimeexecutor/React-runtimeexecutor.podspec | 2 +- packages/react-native/ReactCommon/yoga/Yoga.podspec | 2 +- .../scripts/cocoapods/__tests__/codegen_utils-test.rb | 9 ++++++--- packages/react-native/scripts/cocoapods/codegen_utils.rb | 5 +---- packages/react-native/scripts/react_native_pods.rb | 7 +++++-- .../third-party-podspecs/DoubleConversion.podspec | 2 +- .../react-native/third-party-podspecs/RCT-Folly.podspec | 2 +- packages/react-native/third-party-podspecs/boost.podspec | 2 +- packages/react-native/third-party-podspecs/glog.podspec | 2 +- .../NativeComponentExample/MyNativeView.podspec | 2 +- .../NativeCxxModuleExample.podspec | 2 +- .../NativeModuleExample/ScreenshotManager.podspec | 2 +- packages/rn-tester/RCTTest/React-RCTTest.podspec | 2 +- 51 files changed, 60 insertions(+), 57 deletions(-) diff --git a/packages/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec b/packages/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec index 9b1df44a4716ec..1de8a15ed9f000 100644 --- a/packages/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +++ b/packages/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/actionsheetios" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "*.{m}" s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index 60370d69fc04a7..10b4ed0f996267 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -60,7 +60,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/actionsheetios" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{c,h,m,mm,S,cpp}" diff --git a/packages/react-native/Libraries/Blob/React-RCTBlob.podspec b/packages/react-native/Libraries/Blob/React-RCTBlob.podspec index 90695d569b0e3c..1c8fe558490dce 100644 --- a/packages/react-native/Libraries/Blob/React-RCTBlob.podspec +++ b/packages/react-native/Libraries/Blob/React-RCTBlob.podspec @@ -39,7 +39,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{h,m,mm}" diff --git a/packages/react-native/Libraries/FBLazyVector/FBLazyVector.podspec b/packages/react-native/Libraries/FBLazyVector/FBLazyVector.podspec index 23f131b16bc1d1..009ae434d9ea06 100644 --- a/packages/react-native/Libraries/FBLazyVector/FBLazyVector.podspec +++ b/packages/react-native/Libraries/FBLazyVector/FBLazyVector.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" s.header_dir = "FBLazyVector" diff --git a/packages/react-native/Libraries/Image/React-RCTImage.podspec b/packages/react-native/Libraries/Image/React-RCTImage.podspec index 5df1e93dc7d8f1..9728c425954e00 100644 --- a/packages/react-native/Libraries/Image/React-RCTImage.podspec +++ b/packages/react-native/Libraries/Image/React-RCTImage.podspec @@ -40,7 +40,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/image" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec b/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec index 01bd30132f6ce4..e022b6faf315fe 100644 --- a/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec +++ b/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/linking" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec b/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec index 616e53830c394c..afd7715b0e97b2 100644 --- a/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec +++ b/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec @@ -39,7 +39,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{h,m,mm}" diff --git a/packages/react-native/Libraries/Network/React-RCTNetwork.podspec b/packages/react-native/Libraries/Network/React-RCTNetwork.podspec index 9c1932fc61826d..1f2d2dde5bc9f8 100644 --- a/packages/react-native/Libraries/Network/React-RCTNetwork.podspec +++ b/packages/react-native/Libraries/Network/React-RCTNetwork.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec b/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec index 3bf72a25f95e01..cdbdaa50ab8b60 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +++ b/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec @@ -40,7 +40,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/pushnotificationios" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/packages/react-native/Libraries/RCTRequired/RCTRequired.podspec b/packages/react-native/Libraries/RCTRequired/RCTRequired.podspec index 4e91d8bdac53fd..0d7cf299faf12a 100644 --- a/packages/react-native/Libraries/RCTRequired/RCTRequired.podspec +++ b/packages/react-native/Libraries/RCTRequired/RCTRequired.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" s.header_dir = "RCTRequired" diff --git a/packages/react-native/Libraries/Settings/React-RCTSettings.podspec b/packages/react-native/Libraries/Settings/React-RCTSettings.podspec index 541e7e2fc55218..482595894c33be 100644 --- a/packages/react-native/Libraries/Settings/React-RCTSettings.podspec +++ b/packages/react-native/Libraries/Settings/React-RCTSettings.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/settings" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/packages/react-native/Libraries/Text/React-RCTText.podspec b/packages/react-native/Libraries/Text/React-RCTText.podspec index 6defa4cefec0ce..768c64462689cd 100644 --- a/packages/react-native/Libraries/Text/React-RCTText.podspec +++ b/packages/react-native/Libraries/Text/React-RCTText.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/text" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{h,m}" s.ios.exclude_files = "**/macOS/*" # [macOS] diff --git a/packages/react-native/Libraries/TypeSafety/RCTTypeSafety.podspec b/packages/react-native/Libraries/TypeSafety/RCTTypeSafety.podspec index fd71464d76b0ee..2e37af9e55a251 100644 --- a/packages/react-native/Libraries/TypeSafety/RCTTypeSafety.podspec +++ b/packages/react-native/Libraries/TypeSafety/RCTTypeSafety.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" s.header_dir = "RCTTypeSafety" diff --git a/packages/react-native/Libraries/Vibration/React-RCTVibration.podspec b/packages/react-native/Libraries/Vibration/React-RCTVibration.podspec index 38fcd836dcbfa9..d8eb8e49d3bb26 100644 --- a/packages/react-native/Libraries/Vibration/React-RCTVibration.podspec +++ b/packages/react-native/Libraries/Vibration/React-RCTVibration.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/vibration" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/packages/react-native/React-Core.podspec b/packages/react-native/React-Core.podspec index e4c436b14b1a46..88fef2b318684c 100644 --- a/packages/react-native/React-Core.podspec +++ b/packages/react-native/React-Core.podspec @@ -67,7 +67,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.resource_bundle = { "AccessibilityResources" => ["React/AccessibilityResources/*.lproj"]} s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/packages/react-native/React.podspec b/packages/react-native/React.podspec index 13e19cc56ab50a..59b9f8319ae306 100644 --- a/packages/react-native/React.podspec +++ b/packages/react-native/React.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" s.cocoapods_version = ">= 1.10.1" diff --git a/packages/react-native/React/CoreModules/React-CoreModules.podspec b/packages/react-native/React/CoreModules/React-CoreModules.podspec index ba8cb9fe051807..d75973e80c1a27 100644 --- a/packages/react-native/React/CoreModules/React-CoreModules.podspec +++ b/packages/react-native/React/CoreModules/React-CoreModules.podspec @@ -39,7 +39,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{c,m,mm,cpp}" diff --git a/packages/react-native/React/FBReactNativeSpec/FBReactNativeSpec.podspec b/packages/react-native/React/FBReactNativeSpec/FBReactNativeSpec.podspec index 74e3f889c8e5e4..0c65665cf5a685 100644 --- a/packages/react-native/React/FBReactNativeSpec/FBReactNativeSpec.podspec +++ b/packages/react-native/React/FBReactNativeSpec/FBReactNativeSpec.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source # This podspec is used to trigger the codegen, and built files are generated in a different location. diff --git a/packages/react-native/React/React-RCTFabric.podspec b/packages/react-native/React/React-RCTFabric.podspec index b043caf4289ebc..69caa0dddf6c04 100644 --- a/packages/react-native/React/React-RCTFabric.podspec +++ b/packages/react-native/React/React-RCTFabric.podspec @@ -52,7 +52,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}" s.exclude_files = "**/tests/*", diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 6c4378268c10d7..999a26c2761065 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "dummyFile.cpp" s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", diff --git a/packages/react-native/ReactCommon/React-rncore.podspec b/packages/react-native/ReactCommon/React-rncore.podspec index 0c670b28fc65e0..c44a50ade669a5 100644 --- a/packages/react-native/ReactCommon/React-rncore.podspec +++ b/packages/react-native/ReactCommon/React-rncore.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "dummyFile.cpp" s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", diff --git a/packages/react-native/ReactCommon/ReactCommon.podspec b/packages/react-native/ReactCommon/ReactCommon.podspec index 935a4cd52d3483..47699fd76ec110 100644 --- a/packages/react-native/ReactCommon/ReactCommon.podspec +++ b/packages/react-native/ReactCommon/ReactCommon.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/packages/react-native/ReactCommon/callinvoker/React-callinvoker.podspec b/packages/react-native/ReactCommon/callinvoker/React-callinvoker.podspec index 017e718b347294..347ab4cc4ac501 100644 --- a/packages/react-native/ReactCommon/callinvoker/React-callinvoker.podspec +++ b/packages/react-native/ReactCommon/callinvoker/React-callinvoker.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "ReactCommon" diff --git a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec index 95c9bb6b6097eb..794dd93fe5385b 100644 --- a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "*.{cpp,h}" s.exclude_files = "SampleCxxModule.*" diff --git a/packages/react-native/ReactCommon/hermes/React-hermes.podspec b/packages/react-native/ReactCommon/hermes/React-hermes.podspec index 425ef3c84c4005..f9fd1c48e641ef 100644 --- a/packages/react-native/ReactCommon/hermes/React-hermes.podspec +++ b/packages/react-native/ReactCommon/hermes/React-hermes.podspec @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package['license'] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :osx => "10.14", :ios => "12.4" } + s.platforms = min_supported_versions s.source = source s.source_files = "executor/*.{cpp,h}", "inspector/*.{cpp,h}", diff --git a/packages/react-native/ReactCommon/jsc/React-jsc.podspec b/packages/react-native/ReactCommon/jsc/React-jsc.podspec index 043a13de819c00..ee9cf096e7a961 100644 --- a/packages/react-native/ReactCommon/jsc/React-jsc.podspec +++ b/packages/react-native/ReactCommon/jsc/React-jsc.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "JSCRuntime.{cpp,h}" s.exclude_files = "**/test/*" diff --git a/packages/react-native/ReactCommon/jsi/React-jsi.podspec b/packages/react-native/ReactCommon/jsi/React-jsi.podspec index 4724da7e405676..3d83b05803d0ff 100644 --- a/packages/react-native/ReactCommon/jsi/React-jsi.podspec +++ b/packages/react-native/ReactCommon/jsi/React-jsi.podspec @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.header_dir = "jsi" diff --git a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec index 46a77442ac55f0..8b5e6e1fcc7e07 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +++ b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "jsireact/*.{cpp,h}" s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/packages/react-native/ReactCommon/jsinspector/React-jsinspector.podspec b/packages/react-native/ReactCommon/jsinspector/React-jsinspector.podspec index 60ae4eb1939cec..98f717e8339e3c 100644 --- a/packages/react-native/ReactCommon/jsinspector/React-jsinspector.podspec +++ b/packages/react-native/ReactCommon/jsinspector/React-jsinspector.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "*.{cpp,h}" s.header_dir = 'jsinspector' diff --git a/packages/react-native/ReactCommon/logger/React-logger.podspec b/packages/react-native/ReactCommon/logger/React-logger.podspec index f137c5ba66175e..b5a51ca8921047 100644 --- a/packages/react-native/ReactCommon/logger/React-logger.podspec +++ b/packages/react-native/ReactCommon/logger/React-logger.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "*.{cpp,h}" s.exclude_files = "SampleCxxModule.*" diff --git a/packages/react-native/ReactCommon/react/debug/React-debug.podspec b/packages/react-native/ReactCommon/react/debug/React-debug.podspec index c011a957d71ac8..d6e5314989179b 100644 --- a/packages/react-native/ReactCommon/react/debug/React-debug.podspec +++ b/packages/react-native/ReactCommon/react/debug/React-debug.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => min_ios_version_supported, :osx => '10.15' } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "react/debug" diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec index 8fcbf22df0f9b1..454cee8ec61d04 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"", diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec b/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec index b982d46fc5dd8b..8f01c9da93be27 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers\"", diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec index 7ef9431dd9c346..b54d57063b5f7b 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec +++ b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec @@ -34,7 +34,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.source_files = source_files diff --git a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec index 7fa15c10f2d621..b6f86c7d499285 100644 --- a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +++ b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec @@ -34,7 +34,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.source_files = source_files diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec index 4da7e4987b3088..784fabe0edd962 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => min_ios_version_supported, :osx => '10.15' } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{cpp,h}" s.compiler_flags = folly_compiler_flags diff --git a/packages/react-native/ReactCommon/react/utils/React-utils.podspec b/packages/react-native/ReactCommon/react/utils/React-utils.podspec index 083bfa450759d6..9bb7338a9c9b8a 100644 --- a/packages/react-native/ReactCommon/react/utils/React-utils.podspec +++ b/packages/react-native/ReactCommon/react/utils/React-utils.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => min_ios_version_supported, :osx => '10.15' } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{cpp,h,mm}" s.compiler_flags = folly_compiler_flags diff --git a/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec b/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec index 8663e440390bcd..47013b99c38cf3 100644 --- a/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec +++ b/packages/react-native/ReactCommon/reactperflogger/React-perflogger.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "reactperflogger" diff --git a/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec b/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec index c855128ae8df2d..0a6e443579b399 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +++ b/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "ReactCommon" diff --git a/packages/react-native/ReactCommon/yoga/Yoga.podspec b/packages/react-native/ReactCommon/yoga/Yoga.podspec index 0fe42189642505..1079992245004a 100644 --- a/packages/react-native/ReactCommon/yoga/Yoga.podspec +++ b/packages/react-native/ReactCommon/yoga/Yoga.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |spec| ] # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + spec.platforms = min_supported_versions # Set this environment variable when *not* using the `:path` option to install the pod. # E.g. when publishing this spec to a spec repo. diff --git a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb index 50164934580730..ef105d7c458d2e 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -15,7 +15,7 @@ require_relative "./test_utils/CodegenScriptPhaseExtractorMock.rb" require_relative "./test_utils/FileUtilsMock.rb" -# mocking the min_ios_version_supported function +# mocking the min_supported_versions 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 @@ -23,6 +23,10 @@ def min_ios_version_supported return '12.4' end +def min_supported_versions + return { :ios => min_ios_version_supported } +end + class CodegenUtilsTests < Test::Unit::TestCase :base_path @@ -535,8 +539,7 @@ def get_podspec_no_fabric_no_script 'source' => { :git => '' }, 'header_mappings_dir' => './', 'platforms' => { - 'ios' => '12.4', - 'osx' => '10.15', + :ios => '13.4', }, 'source_files' => "**/*.{h,mm,cpp}", 'pod_target_xcconfig' => { diff --git a/packages/react-native/scripts/cocoapods/codegen_utils.rb b/packages/react-native/scripts/cocoapods/codegen_utils.rb index 751e3609e6b327..8a7d758b240ae1 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -112,10 +112,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa 'compiler_flags' => "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++17", 'source' => { :git => '' }, 'header_mappings_dir' => './', - 'platforms' => { - 'ios' => min_ios_version_supported, - 'osx' => '10.15' - }, + 'platforms' => min_supported_versions, 'source_files' => "**/*.{h,mm,cpp}", 'pod_target_xcconfig' => { "HEADER_SEARCH_PATHS" => header_search_paths.join(' '), diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 080b6fc622b743..bdf6d0e9a71b0a 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -35,12 +35,15 @@ {paths: [process.argv[1]]}, )', __dir__]).strip +def min_ios_version_supported + return Helpers::Constants.min_ios_version_supported +end # This function returns the min supported OS versions 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 Helpers::Constants.min_ios_version_supported +def min_supported_versions + return { :ios => min_ios_version_supported } end # This function prepares the project for React Native, before processing diff --git a/packages/react-native/third-party-podspecs/DoubleConversion.podspec b/packages/react-native/third-party-podspecs/DoubleConversion.podspec index 4a024112c851ff..6bef28610d4b65 100644 --- a/packages/react-native/third-party-podspecs/DoubleConversion.podspec +++ b/packages/react-native/third-party-podspecs/DoubleConversion.podspec @@ -21,6 +21,6 @@ Pod::Spec.new do |spec| spec.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/DoubleConversion\"" } # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + spec.platforms = min_supported_versions end diff --git a/packages/react-native/third-party-podspecs/RCT-Folly.podspec b/packages/react-native/third-party-podspecs/RCT-Folly.podspec index 1548a7142de976..84e5b354d9b30c 100644 --- a/packages/react-native/third-party-podspecs/RCT-Folly.podspec +++ b/packages/react-native/third-party-podspecs/RCT-Folly.podspec @@ -152,5 +152,5 @@ Pod::Spec.new do |spec| # Folly has issues when compiled with iOS 10 set as deployment target # See https://github.com/facebook/folly/issues/1470 for details - spec.platforms = { :ios => "9.0", :osx => "10.15" } # [macOS] + spec.platforms = min_supported_versions end diff --git a/packages/react-native/third-party-podspecs/boost.podspec b/packages/react-native/third-party-podspecs/boost.podspec index 7e34c9e5e3cb7b..39c53e2b2ce2aa 100644 --- a/packages/react-native/third-party-podspecs/boost.podspec +++ b/packages/react-native/third-party-podspecs/boost.podspec @@ -15,7 +15,7 @@ Pod::Spec.new do |spec| :sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' } # Pinning to the same version as React.podspec. - spec.platforms = { :ios => '11.0', :osx => "10.15" } # [macOS] + spec.platforms = min_supported_versions spec.requires_arc = false spec.module_name = 'boost' diff --git a/packages/react-native/third-party-podspecs/glog.podspec b/packages/react-native/third-party-podspecs/glog.podspec index 24231a43afa5e5..d339c3bc4acdea 100644 --- a/packages/react-native/third-party-podspecs/glog.podspec +++ b/packages/react-native/third-party-podspecs/glog.podspec @@ -33,6 +33,6 @@ Pod::Spec.new do |spec| "HEADER_SEARCH_PATHS" => "$(PODS_TARGET_SRCROOT)/src" } # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + spec.platforms = min_supported_versions end diff --git a/packages/rn-tester/NativeComponentExample/MyNativeView.podspec b/packages/rn-tester/NativeComponentExample/MyNativeView.podspec index 1e686e4ca7df3c..49d150495fe467 100644 --- a/packages/rn-tester/NativeComponentExample/MyNativeView.podspec +++ b/packages/rn-tester/NativeComponentExample/MyNativeView.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.description = "my-native-view" s.homepage = "https://github.com/sota000/my-native-view.git" s.license = "MIT" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = boost_compiler_flags + ' -Wno-nullability-completeness' s.author = "Meta Platforms, Inc. and its affiliates" s.source = { :git => "https://github.com/facebook/my-native-view.git", :tag => "#{s.version}" } diff --git a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.podspec b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.podspec index 0e3641c1e95ba6..81fb57362af56a 100644 --- a/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.podspec +++ b/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.podspec @@ -14,7 +14,7 @@ Pod::Spec.new do |s| s.description = "NativeCxxModuleExample" s.homepage = "https://github.com/facebook/react-native.git" s.license = "MIT" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macos] + s.platforms = min_supported_versions s.compiler_flags = '-Wno-nullability-completeness' s.author = "Meta Platforms, Inc. and its affiliates" s.source = { :git => "https://github.com/facebook/react-native.git", :tag => "#{s.version}" } diff --git a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec index 276714210aaa9f..d132078b9136c3 100644 --- a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec +++ b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.description = "ScreenshotManager" s.homepage = "https://github.com/facebook/react-native.git" s.license = "MIT" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = '-Wno-nullability-completeness' s.author = "Meta Platforms, Inc. and its affiliates" s.source = { :git => "https://github.com/facebook/react-native.git", :tag => "#{s.version}" } diff --git a/packages/rn-tester/RCTTest/React-RCTTest.podspec b/packages/rn-tester/RCTTest/React-RCTTest.podspec index b1969fad2a0dc7..77658d2f875ba5 100644 --- a/packages/rn-tester/RCTTest/React-RCTTest.podspec +++ b/packages/rn-tester/RCTTest/React-RCTTest.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = { :ios => "12.4", :osx => "10.15" } # [macOS] + s.platforms = min_supported_versions s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{h,m,mm}" From cf0beae3f0fb6db8b82cabe36c0714306e6b3c54 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 19 Jan 2024 15:16:54 -0800 Subject: [PATCH 3/3] Set macOS deployment target --- .../scripts/cocoapods/__tests__/codegen_utils-test.rb | 8 +++++++- packages/react-native/scripts/cocoapods/helpers.rb | 5 +++++ packages/react-native/scripts/cocoapods/utils.rb | 1 + packages/react-native/scripts/react_native_pods.rb | 8 +++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb index ef105d7c458d2e..b8f901d9aafc89 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -23,8 +23,14 @@ def min_ios_version_supported return '12.4' end +# [macOS +def min_macos_version_supported + return '10.15' +end +# macOS] + def min_supported_versions - return { :ios => min_ios_version_supported } + return { :ios => min_ios_version_supported, :osx => min_macos_version_supported } # [macOS] end class CodegenUtilsTests < Test::Unit::TestCase diff --git a/packages/react-native/scripts/cocoapods/helpers.rb b/packages/react-native/scripts/cocoapods/helpers.rb index 6d2a58d5973fe7..a21c018b3d1101 100644 --- a/packages/react-native/scripts/cocoapods/helpers.rb +++ b/packages/react-native/scripts/cocoapods/helpers.rb @@ -40,5 +40,10 @@ class Constants def self.min_ios_version_supported return '12.4' end + # [macOS + def self.min_macos_version_supported + return '10.15' + end + # macOS] end end diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 0d3befb0c37d82..b6c7d7176bce3c 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -274,6 +274,7 @@ def self.updateOSDeploymentTarget(installer) end target_installation_result.native_target.build_configurations.each do |config| config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported + config.build_settings["MACOSX_DEPLOYMENT_TARGET"] = Helpers::Constants.min_macos_version_supported # [macOS] end end end diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index bdf6d0e9a71b0a..16d10865149c99 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -39,11 +39,17 @@ def min_ios_version_supported return Helpers::Constants.min_ios_version_supported end +# [macOS +def min_macos_version_supported + return Helpers::Constants.min_macos_version_supported +end +# macOS] + # This function returns the min supported OS versions 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_supported_versions - return { :ios => min_ios_version_supported } + return { :ios => min_ios_version_supported, :osx => min_macos_version_supported } # [macOS] end # This function prepares the project for React Native, before processing