Skip to content

Commit

Permalink
Migrate React-RCTBlob to add_dependency
Browse files Browse the repository at this point in the history
Summary:
This change migrate React-RCTBlob to the new add_dependency to improve its compatibility with macOS and to remove some maintenance burden.

## Context
Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](microsoft#1967) where I manually make MacOS work with `use_framewroks!`

## Changelog:
[Internal] - Add helper function to create header_search_path

Differential Revision: D51030365
  • Loading branch information
Riccardo Cipolleschi authored and facebook-github-bot committed Nov 7, 2023
1 parent e09ca7d commit 69ff8a8
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions packages/react-native/Libraries/Blob/React-RCTBlob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,8 @@ folly_version = '2023.08.07.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]

if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
])
end

Pod::Spec.new do |s|
s.name = "React-RCTBlob"
s.version = version
Expand All @@ -52,12 +44,14 @@ Pod::Spec.new do |s|
}

s.dependency "RCT-Folly", folly_version
s.dependency "React-Codegen", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "React-Core/RCTBlobHeaders", version
s.dependency "React-Core/RCTWebSocket", version
s.dependency "React-RCTNetwork", version
s.dependency "React-jsi"
s.dependency "React-Core/RCTBlobHeaders"
s.dependency "React-Core/RCTWebSocket"
s.dependency "React-RCTNetwork"

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

if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
s.dependency "hermes-engine"
Expand Down

0 comments on commit 69ff8a8

Please sign in to comment.