diff --git a/packages/react-native/scripts/cocoapods/helpers.rb b/packages/react-native/scripts/cocoapods/helpers.rb index 5ef30a3e77e..74fb3be74fa 100644 --- a/packages/react-native/scripts/cocoapods/helpers.rb +++ b/packages/react-native/scripts/cocoapods/helpers.rb @@ -37,6 +37,28 @@ end module Helpers class Constants + @@boost_config = { + :git => "https://github.com/react-native-community/boost-for-react-native", + } + + @@folly_config = { + :version => '2024.01.01.00', + :git => 'https://github.com/facebook/folly.git', + :compiler_flags => '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32' + } + + @@fmt_config = { + :git => "https://github.com/fmtlib/fmt.git", + } + + @@glog_config = { + :git => "https://github.com/google/glog.git", + } + + @@double_conversion_config = { + :git => "https://github.com/google/double-conversion.git", + } + def self.min_ios_version_supported return '13.4' end @@ -46,10 +68,43 @@ module Helpers end def self.folly_config - return { - :version => '2024.01.01.00', - :compiler_flags => '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32' - } + return @@folly_config + end + + def self.set_folly_config(new_folly_config) + @@folly_config.update(new_folly_config) + end + + def self.boost_config + return @@boost_config + end + + def self.set_boost_config(new_boost_config) + @@boost_config.update(new_boost_config) + end + + def self.fmt_config + return @@fmt_config + end + + def self.set_fmt_config(new_fmt_config) + @@fmt_config.update(new_fmt_config) + end + + def self.glog_config + return @@glog_config + end + + def self.set_glog_config(new_glog_config) + @@glog_config.update(new_glog_config) + end + + def self.double_conversion_config + return @@double_conversion_config + end + + def self.set_double_conversion_config(new_double_conversion_config) + @@double_conversion_config.update(new_double_conversion_config) end def self.cxx_language_standard diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 97e82472ee4..f342313626b 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -264,15 +264,73 @@ def get_default_flags() return ReactNativePodsUtils.get_default_flags() end -# This method returns an hash with the folly version and the folli compiler flags +# This method returns an hash with the folly version, folly git url and the folly compiler flags # that can be used to configure libraries. # In this way, we can update those values in react native, and all the libraries will benefit # from it. -# @return an hash with the `:version` and `:compiler_flags` fields. +# @return an hash with the `:version`, `:git` and `:compiler_flags` fields. def get_folly_config() return Helpers::Constants.folly_config end +# This method returns an hash with the glog git url +# that can be used to configure libraries. +# @return an hash with the `:git` field. +def get_glog_config() + return Helpers::Constants.glog_config +end + +# This method returns an hash with the fmt git url +# that can be used to configure libraries. +# @return an hash with the `:git` field. +def get_fmt_config() + return Helpers::Constants.fmt_config +end + +# This method returns an hash with the double conversion git url +# that can be used to configure libraries. +# @return an hash with the `:git` field. +def get_double_conversion_config() + return Helpers::Constants.double_conversion_config +end + +# This method returns an hash with the double conversion git url +# that can be used to configure libraries. +# @return an hash with the `:git` field. +def get_boost_config() + return Helpers::Constants.boost_config +end + +# This method can be used to set the glog config +# that can be used to configure libraries. +def set_folly_config(folly_config) + Helpers::Constants.set_folly_config(folly_config) +end + +# This method can be used to set the glog config +# that can be used to configure libraries. +def set_glog_config(glog_config) + Helpers::Constants.set_glog_config(glog_config) +end + +# This method can be used to set the fmt config +# that can be used to configure libraries. +def set_fmt_config(fmt_config) + Helpers::Constants.set_fmt_config(fmt_config) +end + +# This method can be used to set the double conversion config +# that can be used to configure libraries. +def set_double_conversion_config(double_conversion_config) + Helpers::Constants.set_double_conversion_config(double_conversion_config) +end + +# This method can be used to set the boost config +# that can be used to configure libraries. +def set_boost_config(boost_config) + Helpers::Constants.set_boost_config(boost_config) +end + def rct_cxx_language_standard() return Helpers::Constants.cxx_language_standard end diff --git a/packages/react-native/third-party-podspecs/DoubleConversion.podspec b/packages/react-native/third-party-podspecs/DoubleConversion.podspec index 9d33cffed6c..36e675464e7 100644 --- a/packages/react-native/third-party-podspecs/DoubleConversion.podspec +++ b/packages/react-native/third-party-podspecs/DoubleConversion.podspec @@ -3,6 +3,9 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +double_conversion_config = get_double_conversion_config() +double_conversion_git_url = double_conversion_config[:git] + Pod::Spec.new do |spec| spec.name = 'DoubleConversion' spec.version = '1.1.6' @@ -11,7 +14,7 @@ Pod::Spec.new do |spec| spec.summary = 'Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles' spec.authors = 'Google' spec.prepare_command = 'mv src double-conversion' - spec.source = { :git => 'https://github.com/google/double-conversion.git', + spec.source = { :git => double_conversion_git_url, :tag => "v#{spec.version}" } spec.module_name = 'DoubleConversion' spec.header_dir = 'double-conversion' diff --git a/packages/react-native/third-party-podspecs/RCT-Folly.podspec b/packages/react-native/third-party-podspecs/RCT-Folly.podspec index ec77b9b95ed..0f79c326b9b 100644 --- a/packages/react-native/third-party-podspecs/RCT-Folly.podspec +++ b/packages/react-native/third-party-podspecs/RCT-Folly.podspec @@ -6,6 +6,7 @@ folly_config = get_folly_config() folly_compiler_flags = folly_config[:compiler_flags] folly_release_version = folly_config[:version] +folly_git_url = folly_config[:git] Pod::Spec.new do |spec| spec.name = 'RCT-Folly' @@ -15,7 +16,7 @@ Pod::Spec.new do |spec| spec.homepage = 'https://github.com/facebook/folly' spec.summary = 'An open-source C++ library developed and used at Facebook.' spec.authors = 'Facebook' - spec.source = { :git => 'https://github.com/facebook/folly.git', + spec.source = { :git => folly_git_url, :tag => "v#{folly_release_version}" } spec.module_name = 'folly' spec.header_mappings_dir = '.' diff --git a/packages/react-native/third-party-podspecs/boost.podspec b/packages/react-native/third-party-podspecs/boost.podspec index d130fb0ad41..585af409718 100644 --- a/packages/react-native/third-party-podspecs/boost.podspec +++ b/packages/react-native/third-party-podspecs/boost.podspec @@ -3,6 +3,9 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +boost_config = get_boost_config() +boost_git_url = boost_config[:git] + Pod::Spec.new do |spec| spec.name = 'boost' spec.version = '1.84.0' @@ -10,7 +13,7 @@ Pod::Spec.new do |spec| spec.homepage = 'http://www.boost.org' spec.summary = 'Boost provides free peer-reviewed portable C++ source libraries.' spec.authors = 'Rene Rivera' - spec.source = { :git => "https://github.com/react-native-community/boost-for-react-native", + spec.source = { :git => boost_git_url, :tag => "v1.84.0" } # Pinning to the same version as React.podspec. diff --git a/packages/react-native/third-party-podspecs/fmt.podspec b/packages/react-native/third-party-podspecs/fmt.podspec index 3bd0c2007d2..cdfd5269f9a 100644 --- a/packages/react-native/third-party-podspecs/fmt.podspec +++ b/packages/react-native/third-party-podspecs/fmt.podspec @@ -3,6 +3,9 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +fmt_config = get_fmt_config() +fmt_git_url = fmt_config[:git] + Pod::Spec.new do |spec| spec.name = "fmt" spec.version = "9.1.0" @@ -11,7 +14,7 @@ Pod::Spec.new do |spec| spec.summary = "{fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams." spec.authors = "The fmt contributors" spec.source = { - :git => "https://github.com/fmtlib/fmt.git", + :git => fmt_git_url, :tag => "9.1.0" } spec.pod_target_xcconfig = { diff --git a/packages/react-native/third-party-podspecs/glog.podspec b/packages/react-native/third-party-podspecs/glog.podspec index ee1b5fbb605..04857067c60 100644 --- a/packages/react-native/third-party-podspecs/glog.podspec +++ b/packages/react-native/third-party-podspecs/glog.podspec @@ -3,6 +3,9 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +glog_config = get_glog_config() +glog_git_url = glog_config[:git] + Pod::Spec.new do |spec| spec.name = 'glog' spec.version = '0.3.5' @@ -12,7 +15,7 @@ Pod::Spec.new do |spec| spec.authors = 'Google' spec.prepare_command = File.read("../scripts/ios-configure-glog.sh") - spec.source = { :git => 'https://github.com/google/glog.git', + spec.source = { :git => glog_git_url, :tag => "v#{spec.version}" } spec.module_name = 'glog' spec.header_dir = 'glog'