Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update podspecs to use the ReactNativeDependencies or build from source (#49812) #49968

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup-xcode-build-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ runs:
uses: actions/cache@v4
with:
path: packages/rn-tester/Podfile.lock
key: v11-podfilelock-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version }}
key: v12-podfilelock-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version }}
- name: Cache cocoapods
uses: actions/cache@v4
with:
path: packages/rn-tester/Pods
key: v13-cocoapods-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
key: v14-cocoapods-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,17 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

is_new_arch_enabled = ENV["RCT_NEW_ARCH_ENABLED"] != "0"
use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'

new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED=1" : "")
hermes_flag = (use_hermes ? " -DUSE_HERMES=1" : "")
use_third_party_jsc_flag = ENV['USE_THIRD_PARTY_JSC'] == '1' ? " -DUSE_THIRD_PARTY_JSC=1" : ""
other_cflags = "$(inherited) " + folly_compiler_flags + new_arch_enabled_flag + hermes_flag + use_third_party_jsc_flag
other_cflags = "$(inherited) " + new_arch_enabled_flag + hermes_flag + use_third_party_jsc_flag

header_search_paths = [
"$(PODS_TARGET_SRCROOT)/../../ReactCommon",
"$(PODS_ROOT)/Headers/Private/React-Core",
"$(PODS_ROOT)/boost",
"$(PODS_ROOT)/DoubleConversion",
"$(PODS_ROOT)/fast_float/include",
"$(PODS_ROOT)/fmt/include",
"$(PODS_ROOT)/RCT-Folly",
"${PODS_ROOT}/Headers/Public/FlipperKit",
"$(PODS_ROOT)/Headers/Public/ReactCommon",
"$(PODS_ROOT)/Headers/Public/React-RCTFabric",
Expand Down Expand Up @@ -68,7 +59,6 @@ Pod::Spec.new do |s|
s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Private/Yoga\""}

s.dependency "React-Core"
s.dependency "RCT-Folly", folly_version
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "React-RCTNetwork"
Expand All @@ -93,4 +83,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-RCTRuntime", :framework_name => "RCTRuntime")

depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
end
17 changes: 3 additions & 14 deletions packages/react-native/Libraries/Blob/React-RCTBlob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"$(PODS_ROOT)/boost\"",
"\"$(PODS_ROOT)/DoubleConversion\"",
"\"$(PODS_ROOT)/fast_float/include\"",
"\"$(PODS_ROOT)/fmt/include\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -37,7 +28,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "*.{h,m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand All @@ -48,10 +39,6 @@ Pod::Spec.new do |s|
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}

s.dependency "DoubleConversion"
s.dependency "fast_float"
s.dependency "fmt", "11.0.2"
s.dependency "RCT-Folly", folly_version
s.dependency "React-jsi"
s.dependency "React-Core/RCTBlobHeaders"
s.dependency "React-Core/RCTWebSocket"
Expand All @@ -65,4 +52,6 @@ Pod::Spec.new do |s|
if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
s.dependency "hermes-engine"
end

add_rn_third_party_dependencies(s)
end
9 changes: 2 additions & 7 deletions packages/react-native/Libraries/Image/React-RCTImage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -35,7 +30,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand All @@ -47,7 +42,6 @@ Pod::Spec.new do |s|
}
s.framework = ["Accelerate", "UIKit", "QuartzCore", "ImageIO", "CoreGraphics"]

s.dependency "RCT-Folly", folly_version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTImageHeaders"
Expand All @@ -57,4 +51,5 @@ Pod::Spec.new do |s|
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")

add_rn_third_party_dependencies(s)
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -34,7 +29,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -33,7 +28,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "**/*.{h,m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand All @@ -45,12 +40,13 @@ Pod::Spec.new do |s|
}
s.framework = ["UIKit", "QuartzCore"]

s.dependency "RCT-Folly", folly_version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTAnimationHeaders"

add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")

add_rn_third_party_dependencies(s)
end
10 changes: 3 additions & 7 deletions packages/react-native/Libraries/Network/React-RCTNetwork.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -33,7 +28,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand All @@ -45,12 +40,13 @@ Pod::Spec.new do |s|
}
s.frameworks = "MobileCoreServices"

s.dependency "RCT-Folly", folly_version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTNetworkHeaders"

add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])

add_rn_third_party_dependencies(s)
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -34,7 +29,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -34,7 +29,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand All @@ -45,12 +40,13 @@ Pod::Spec.new do |s|
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}

s.dependency "RCT-Folly", folly_version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTSettingsHeaders"

add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])

add_rn_third_party_dependencies(s)
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]

Expand All @@ -34,7 +29,7 @@ Pod::Spec.new do |s|
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.compiler_flags = '-Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand All @@ -46,11 +41,12 @@ Pod::Spec.new do |s|
}
s.frameworks = "AudioToolbox"

s.dependency "RCT-Folly", folly_version
s.dependency "React-jsi"
s.dependency "React-Core/RCTVibrationHeaders"

add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")

add_rn_third_party_dependencies(s)
end
23 changes: 3 additions & 20 deletions packages/react-native/React-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

socket_rocket_config = get_socket_rocket_config()
socket_rocket_version = socket_rocket_config[:version]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
use_hermes_flag = use_hermes ? "-DUSE_HERMES=1" : ""
use_third_party_jsc_flag = ENV['USE_THIRD_PARTY_JSC'] == '1' ? "-DUSE_THIRD_PARTY_JSC=1" : ""
Expand All @@ -49,11 +39,6 @@ frameworks_search_paths << "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-hermes\"" if

header_search_paths = [
"$(PODS_TARGET_SRCROOT)/ReactCommon",
"$(PODS_ROOT)/boost",
"$(PODS_ROOT)/DoubleConversion",
"$(PODS_ROOT)/fast_float/include",
"$(PODS_ROOT)/fmt/include",
"$(PODS_ROOT)/RCT-Folly",
"${PODS_ROOT}/Headers/Public/FlipperKit",
"$(PODS_ROOT)/Headers/Public/ReactCommon",
].concat(use_hermes ? [
Expand All @@ -71,7 +56,7 @@ Pod::Spec.new do |s|
s.platforms = min_supported_versions
s.source = source
s.resource_bundle = { "RCTI18nStrings" => ["React/I18n/strings/*.lproj"]}
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + ' ' + use_hermes_flag + ' ' + use_third_party_jsc_flag
s.compiler_flags = use_hermes_flag + ' ' + use_third_party_jsc_flag
s.header_dir = "React"
s.weak_framework = "JavaScriptCore"
s.pod_target_xcconfig = {
Expand All @@ -97,7 +82,7 @@ Pod::Spec.new do |s|
]
# If we are using Hermes (the default is use hermes, so USE_HERMES can be nil), we don't have jsc installed
# So we have to exclude the JSCExecutorFactory
if use_hermes
if use_hermes
exclude_files = exclude_files.append("React/CxxBridge/JSCExecutorFactory.{h,mm}")
elsif ENV['USE_THIRD_PARTY_JSC'] == '1'
exclude_files = exclude_files.append("React/CxxBridge/JSCExecutorFactory.{h,mm}")
Expand Down Expand Up @@ -130,17 +115,14 @@ Pod::Spec.new do |s|
end
end

s.dependency "RCT-Folly", folly_version
s.dependency "React-cxxreact"
s.dependency "React-perflogger"
s.dependency "React-jsi"
s.dependency "React-jsiexecutor"
s.dependency "React-utils"
s.dependency "React-featureflags"
s.dependency "SocketRocket", socket_rocket_version
s.dependency "React-runtimescheduler"
s.dependency "Yoga"
s.dependency "glog"

s.resource_bundles = {'React-Core_privacy' => 'React/Resources/PrivacyInfo.xcprivacy'}

Expand All @@ -149,4 +131,5 @@ Pod::Spec.new do |s|
add_dependency(s, "RCTDeprecation")

depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
end
Loading
Loading