Skip to content

Commit c9263e7

Browse files
chrfalchmotiz88
authored andcommitted
add support for USE_FRAMEWORKS when using prebuilt React Native Core (#52489)
Summary: When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework. This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework. In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes. bypass-github-export-checks ## Changelog: [IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core Pull Request resolved: #52489 Test Plan: RNTester: - Builds without USE_FRAMEWORKS as before with/without prebuilt - Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code. - Same goes for the static variant. Reviewed By: mdvacca Differential Revision: D78012332 Pulled By: cipolleschi fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
1 parent bbb322b commit c9263e7

55 files changed

Lines changed: 101 additions & 34 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,5 @@ Pod::Spec.new do |s|
8484

8585
depend_on_js_engine(s)
8686
add_rn_third_party_dependencies(s)
87+
add_rncore_dependency(s)
8788
end

packages/react-native/Libraries/Blob/React-RCTBlob.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ Pod::Spec.new do |s|
5555
end
5656

5757
add_rn_third_party_dependencies(s)
58+
add_rncore_dependency(s)
5859
end

packages/react-native/Libraries/Image/React-RCTImage.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ Pod::Spec.new do |s|
5353
add_dependency(s, "React-NativeModulesApple")
5454

5555
add_rn_third_party_dependencies(s)
56+
add_rncore_dependency(s)
5657
end

packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ Pod::Spec.new do |s|
5050
add_dependency(s, "React-featureflags")
5151

5252
add_rn_third_party_dependencies(s)
53+
add_rncore_dependency(s)
5354
end

packages/react-native/Libraries/Network/React-RCTNetwork.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ Pod::Spec.new do |s|
5252
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
5353

5454
add_rn_third_party_dependencies(s)
55+
add_rncore_dependency(s)
5556
end

packages/react-native/Libraries/Settings/React-RCTSettings.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
4949
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
5050

5151
add_rn_third_party_dependencies(s)
52+
add_rncore_dependency(s)
5253
end

packages/react-native/Libraries/Vibration/React-RCTVibration.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
4949
add_dependency(s, "React-NativeModulesApple")
5050

5151
add_rn_third_party_dependencies(s)
52+
add_rncore_dependency(s)
5253
end

packages/react-native/React-Core.podspec

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ Pod::Spec.new do |s|
8383
ss.exclude_files = exclude_files
8484
ss.private_header_files = "React/Cxx*/*.h"
8585

86-
# Include prebuilt if we're not building from source
87-
if !ReactNativeCoreUtils.build_rncore_from_source()
88-
ss.dependency "React-Core-prebuilt", version
89-
end
9086
end
9187

9288
s.subspec "DevSupport" do |ss|
@@ -137,4 +133,5 @@ Pod::Spec.new do |s|
137133

138134
depend_on_js_engine(s)
139135
add_rn_third_party_dependencies(s)
136+
add_rncore_dependency(s)
140137
end

packages/react-native/React/CoreModules/React-CoreModules.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ Pod::Spec.new do |s|
6363
add_dependency(s, "React-NativeModulesApple")
6464

6565
add_rn_third_party_dependencies(s)
66+
add_rncore_dependency(s)
6667
end

packages/react-native/React/React-RCTFBReactNativeSpec.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Pod::Spec.new do |s|
6161

6262
depend_on_js_engine(s)
6363
add_rn_third_party_dependencies(s)
64+
add_rncore_dependency(s)
6465

6566
s.subspec "components" do |ss|
6667
ss.source_files = podspec_sources("FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{m,mm,cpp,h}", "FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{h}")

0 commit comments

Comments
 (0)