mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
[LOCAL] Update Xcode 15 patches to be more robust
This commit is contained in:
@@ -566,7 +566,7 @@ class UtilsTests < Test::Unit::TestCase
|
||||
# Assert
|
||||
user_project_mock.build_configurations.each do |config|
|
||||
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
|
||||
assert_equal("$(inherited) -Wl -ld_classic ", config.build_settings["OTHER_LDFLAGS"])
|
||||
assert_equal("$(inherited) -Wl -ld_classic", config.build_settings["OTHER_LDFLAGS"])
|
||||
end
|
||||
|
||||
# User project and Pods project
|
||||
@@ -616,7 +616,7 @@ class UtilsTests < Test::Unit::TestCase
|
||||
# Assert
|
||||
user_project_mock.build_configurations.each do |config|
|
||||
assert_equal("$(inherited) _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION", config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"])
|
||||
assert_equal("$(inherited) ", config.build_settings["OTHER_LDFLAGS"])
|
||||
assert_equal("$(inherited)", config.build_settings["OTHER_LDFLAGS"])
|
||||
end
|
||||
|
||||
# User project and Pods project
|
||||
|
||||
+18
-12
@@ -60,7 +60,7 @@ class ReactNativePodsUtils
|
||||
.push(installer.pods_project)
|
||||
|
||||
|
||||
# Hermes does not support `i386` architecture
|
||||
# Hermes does not support 'i386' architecture
|
||||
excluded_archs_default = ReactNativePodsUtils.has_pod(installer, 'hermes-engine') ? "i386" : ""
|
||||
|
||||
projects.each do |project|
|
||||
@@ -174,7 +174,7 @@ class ReactNativePodsUtils
|
||||
if self.is_using_xcode15_or_greter(:xcodebuild_manager => xcodebuild_manager)
|
||||
self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
|
||||
else
|
||||
self.remove_value_to_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
|
||||
self.remove_value_from_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
|
||||
end
|
||||
end
|
||||
project.save()
|
||||
@@ -255,20 +255,26 @@ class ReactNativePodsUtils
|
||||
|
||||
def self.add_value_to_setting_if_missing(config, setting_name, value)
|
||||
old_config = config.build_settings[setting_name]
|
||||
if !old_config.include?(value)
|
||||
config.build_settings[setting_name] << value
|
||||
if old_config.is_a?(Array)
|
||||
old_config = old_config.join(" ")
|
||||
end
|
||||
|
||||
trimmed_value = value.strip()
|
||||
if !old_config.include?(trimmed_value)
|
||||
config.build_settings[setting_name] = "#{old_config.strip()} #{trimmed_value}".strip()
|
||||
end
|
||||
end
|
||||
|
||||
def self.remove_value_to_setting_if_present(config, setting_name, value)
|
||||
def self.remove_value_from_setting_if_present(config, setting_name, value)
|
||||
old_config = config.build_settings[setting_name]
|
||||
if old_config.include?(value)
|
||||
# Old config can be either an Array or a String
|
||||
if old_config.is_a?(Array)
|
||||
old_config = old_config.join(" ")
|
||||
end
|
||||
new_config = old_config.gsub(value, "")
|
||||
config.build_settings[setting_name] = new_config
|
||||
if old_config.is_a?(Array)
|
||||
old_config = old_config.join(" ")
|
||||
end
|
||||
|
||||
trimmed_value = value.strip()
|
||||
if old_config.include?(trimmed_value)
|
||||
new_config = old_config.gsub(trimmed_value, "")
|
||||
config.build_settings[setting_name] = new_config.strip()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user