Skip to content

Commit 1f66f33

Browse files
jtreanorTMomemt
authored andcommitted
CocoaPods frameworks compatibility: Step 1 (facebook#25496)
Summary: This is the first step towards fixing facebook#25349. These are the changes to the podspec to correctly update dependencies and build config that will cause any breaking change for users or libraries. I am breaking these changes out from facebook#25393 as suggested by fkgozali in facebook#25393 (comment). These are the changes: - Made C++ headers in `React-Core` private by default so that ObjC files can import the module without failures. - Reduced the number of `yoga` headers that are exposed for the same reason as above. As far as I can see this doesn't cause issues but we can find another solution if it does. - Adding some missing dependencies to fix undefined symbols errors. - Added `DoubleConversion` to `HEADER_SEARCH_PATHS` where it was missing. [iOS] [Fixed] - Updated podspecs for improved compatibility with different install types. Pull Request resolved: facebook#25496 Test Plan: Everything should work exactly as before. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which points at this branch to show that it is still working `Podfile` to demonstrate this is fixed. You can see that it works with these steps: 1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git` 2. `git checkout podspec-updates` 3. `cd ios && pod install` 4. `cd .. && react-native run-ios` The sample app will build and run successfully. Reviewed By: mmmulani Differential Revision: D16167346 Pulled By: fkgozali fbshipit-source-id: 1917b2f8779cb172362a457fb3fce686c55056d3
1 parent eec4dc6 commit 1f66f33

10 files changed

+71
-35
lines changed

RNTester/Podfile.lock

+48-26
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,24 @@ PODS:
2828
- React-Core (= 1000.0.0)
2929
- React-Core (1000.0.0):
3030
- Folly (= 2018.10.22.00)
31+
- glog
32+
- React-Core/Default (= 1000.0.0)
33+
- React-cxxreact (= 1000.0.0)
34+
- React-jsi (= 1000.0.0)
35+
- React-jsiexecutor (= 1000.0.0)
36+
- yoga (= 1000.0.0.React)
37+
- React-Core/CxxBridge (1000.0.0):
38+
- Folly (= 2018.10.22.00)
39+
- glog
40+
- React-cxxreact (= 1000.0.0)
41+
- React-jsi (= 1000.0.0)
42+
- React-jsiexecutor (= 1000.0.0)
43+
- yoga (= 1000.0.0.React)
44+
- React-Core/Default (1000.0.0):
45+
- Folly (= 2018.10.22.00)
46+
- glog
3147
- React-cxxreact (= 1000.0.0)
48+
- React-jsi (= 1000.0.0)
3249
- React-jsiexecutor (= 1000.0.0)
3350
- yoga (= 1000.0.0.React)
3451
- React-cxxreact (1000.0.0):
@@ -90,23 +107,25 @@ PODS:
90107
- React-fishhook (= 1000.0.0)
91108
- React-turbomodule-core (1000.0.0):
92109
- Folly (= 2018.10.22.00)
93-
- React-Core (= 1000.0.0)
110+
- React-Core/CxxBridge (= 1000.0.0)
94111
- React-cxxreact (= 1000.0.0)
95112
- React-jsi (= 1000.0.0)
96113
- React-turbomodule-core/core-ios (= 1000.0.0)
97114
- React-turbomodule-core/core-ios (1000.0.0):
98115
- Folly (= 2018.10.22.00)
99-
- React-Core (= 1000.0.0)
116+
- React-Core/CxxBridge (= 1000.0.0)
100117
- React-cxxreact (= 1000.0.0)
101118
- React-jsi (= 1000.0.0)
102119
- React-turbomodule-samples (1000.0.0):
120+
- DoubleConversion
103121
- Folly (= 2018.10.22.00)
104122
- React-Core (= 1000.0.0)
105123
- React-cxxreact (= 1000.0.0)
106124
- React-jsi (= 1000.0.0)
107125
- React-turbomodule-core (= 1000.0.0)
108126
- React-turbomodule-samples/samples-ios (= 1000.0.0)
109127
- React-turbomodule-samples/samples-ios (1000.0.0):
128+
- DoubleConversion
110129
- Folly (= 2018.10.22.00)
111130
- React-Core (= 1000.0.0)
112131
- React-cxxreact (= 1000.0.0)
@@ -208,30 +227,33 @@ SPEC CHECKSUMS:
208227
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
209228
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
210229
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
211-
React: e7b61c9123f89c4cd9becea2122af02568be6e13
212-
React-ART: 3dba78ec04b585a82456d1df4bda7a08dbc83a8d
213-
React-Core: d1c3aa4b1c5c57bf839de3c83396b59c1efbf1ba
214-
React-cxxreact: 5f2b678adbe8ff5256801603e1b496e481bc2430
215-
React-DevSupport: 9bde3ce4f7707d9487759101ea3188f4f07c9003
216-
React-fishhook: a9a43c2c84ab2519809810bcdd363e2774007c69
217-
React-jsi: cdf32eb002ff3e243364a1abb71925e0e93003db
218-
React-jsiexecutor: 6e53c44a5371297f0c9cc39780f12cb3efba3b81
219-
React-jsinspector: 2f42a591151e828d0422cbd3b609eedcb920d58e
220-
React-RCTActionSheet: 4ad4bfac1ba9ec020edf278362855448d607cafd
221-
React-RCTAnimation: f050e9fbe85e5616f74cea7a2557bdfb6be73cee
222-
React-RCTBlob: 9f907aab3417a43bbda84aef76f88ee528e877d4
223-
React-RCTCameraRoll: 288b1007d8e540771b917f89d7d99118a3477ee1
224-
React-RCTImage: 4234a754ebdb922416f5f77cff121c680fd3ccbe
225-
React-RCTLinking: 3a52500942cc73999df19f541b7bda5887c3c43d
226-
React-RCTNetwork: 2042d2648e1160770ac0e5068bb5b648c03296a5
227-
React-RCTPushNotification: 3cfbf863d0597b5da80a15c9a9285a0ad89b23ba
228-
React-RCTSettings: 8099c9d904c0fbe46c463de8791478b5bc72809e
229-
React-RCTText: c4a643a08fce4727316366fea5ad17fa14f72f54
230-
React-RCTVibration: c5933466242187bffe55fa5496f841e04db66c8a
231-
React-RCTWebSocket: 233c66a6394de3816ee46861bbe0dba9f83e45a0
232-
React-turbomodule-core: 7ae77c38b85f6f81be40c0c3dc456d3a5fda4797
233-
React-turbomodule-samples: 483f2c80e81b89197737828405a0ac27c77f58b5
234-
yoga: 56698cdff46e3dbb7aa71fd2fd7dc0ce650dc0fb
230+
RCTRequired: 33f3b89d2d82ef01c02b9b4f8146c43762e509d8
231+
React: 7c652b87c228731c51ab5764de68b6c17e6342be
232+
React-ART: 28f8815acbbc4816cec14866b59911a83eb780ed
233+
React-Core: b85f6553c4b2a31e7d71234c28b51bb928a00cbd
234+
React-CoreModules: 04ea22808b22232b251d462f3309ab1150e3b7dd
235+
React-cxxreact: 7c4242192149ce0205b53efaa03e3bf86ba4337c
236+
React-DevSupport: f34768e3aad3e59ee9800c752a78bc6cb24d0f75
237+
React-jscallinvoker: e730f2eca4cb27830af459c0a9af00ac6691bf4c
238+
React-jsi: 98d1f9d8a79d2720ba6a44c2d928a77f315b7e4f
239+
React-jsiexecutor: c0ab8c80a6e88380d63f583690a50d4a723b47b5
240+
React-jsinspector: ea0a218071a11c3687cef2480580180caa6a64c0
241+
React-RCTActionSheet: caf6532394bdbbe0fc0ec2363c84f26bcfcdd36a
242+
React-RCTAnimation: b324c6eb699637c735650c6180e13d003eeb0e56
243+
React-RCTBlob: 069290c8db758bb1d77523a06d117dd668b6cef3
244+
React-RCTImage: 012d845d919177e2726743ad06052dda66592760
245+
React-RCTLinking: c6fe7b82bed97ce72203b2ce2f4aac87b1e2647f
246+
React-RCTNetwork: 2a2b22a17cd965de53ba21c5ca392d0da84ef322
247+
React-RCTPushNotification: 13729b4a2b63b191f42ba7230a69f462f3b5a7f9
248+
React-RCTSettings: e36d7f7d566b80d4363176c2f76cc5eccfdd0ae1
249+
React-RCTTest: 59213db38d80ff3bf4ff068d6127688687c3d349
250+
React-RCTText: 469ec754592c92fc639825e558908c2f0e783e2c
251+
React-RCTVibration: ade3c169b54f3bc16c9a9918e17e48ef66aee6ba
252+
React-RCTWebSocket: cb5317e9a4adc37191660f819fb21d63433584ef
253+
React-turbomodule-core: 5cce62fb65bd0b19f249bc1c4c54b82b3cf9a749
254+
React-turbomodule-samples: ef5c144b510530cb108d4bdb8615dc3943a802fd
255+
React-TypeSafety: 1de5a1034398108f4ca866b68489734f8dbb4c44
256+
yoga: b72aa5b3708cc93c5897f8297122d6eba1331e07
235257

236258
PODFILE CHECKSUM: bb578b8286c0068879a41ac092c9690cc3ede523
237259

React/React-Core.podspec

+13
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,27 @@ Pod::Spec.new do |s|
4141
"Views/RCTRefreshControl*",
4242
"Views/RCTSlider*",
4343
"Views/RCTSwitch*",
44+
s.private_header_files = "Cxx*/*.h"
4445
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
4546
s.header_dir = "React"
4647
s.framework = "JavaScriptCore"
4748
s.library = "stdc++"
4849
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Folly\"" }
50+
s.default_subspec = "Default"
51+
52+
s.subspec "Default" do |ss|
53+
# no-op
54+
end
55+
56+
s.subspec "CxxBridge" do |ss|
57+
# Make the C++ headers visible if they are needed
58+
ss.public_header_files = "**/*.{h}"
59+
end
4960

5061
s.dependency "Folly", folly_version
5162
s.dependency "React-cxxreact", version
63+
s.dependency "React-jsi", version
5264
s.dependency "React-jsiexecutor", version
5365
s.dependency "yoga", "#{version}.React"
66+
s.dependency "glog"
5467
end

React/React-RCTFabric.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
4242
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/Folly\"",
4343
"OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
4444

45-
s.dependency "React-Core", version
45+
s.dependency "React-Core/CxxBridge", version
4646
s.dependency "React-Fabric", version
4747
s.dependency "React-RCTImage", version
4848
s.dependency "Folly/Fabric", folly_version

ReactCommon/cxxreact/React-cxxreact.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
3333
s.source_files = "*.{cpp,h}"
3434
s.exclude_files = "SampleCxxModule.*"
3535
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
36-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\"" }
36+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
3737
s.header_dir = "cxxreact"
3838

3939
s.dependency "boost-for-react-native", "1.63.0"

ReactCommon/jscallinvoker/React-jscallinvoker.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
3333
s.source_files = "jsireact/*.{cpp,h}"
3434
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
3535
s.header_dir = "jsireact"
36-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\"" }
36+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
3737

3838
s.dependency "React-cxxreact", version
3939
s.dependency "Folly", folly_version

ReactCommon/jsi/React-jsi.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Pod::Spec.new do |s|
3333
s.source_files = "**/*.{cpp,h}"
3434
s.framework = "JavaScriptCore"
3535
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
36-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\"" }
36+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
3737
s.header_dir = "jsi"
3838
s.default_subspec = "Default"
3939

ReactCommon/jsiexecutor/React-jsiexecutor.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Pod::Spec.new do |s|
3232
s.source = source
3333
s.source_files = "jsireact/*.{cpp,h}"
3434
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
35-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\"" }
35+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
3636
s.header_dir = "jsireact"
3737

3838
s.dependency "React-cxxreact", version

ReactCommon/turbomodule/core/React-turbomodule-core.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ Pod::Spec.new do |s|
3232
s.source = source
3333
s.source_files = "*.{cpp,h}"
3434
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
35-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\"" }
3635
s.header_dir = "jsireact"
36+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
3737
s.xcconfig = { "OTHER_CFLAGS" => "$(inherited) -DRN_TURBO_MODULE_ENABLED" }
3838

39-
s.dependency "React-Core", version
39+
s.dependency "React-Core/CxxBridge", version
4040
s.dependency "React-cxxreact", version
4141
s.dependency "React-jsi", version
4242
s.dependency "Folly", folly_version

ReactCommon/turbomodule/samples/React-turbomodule-samples.podspec

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ Pod::Spec.new do |s|
3232
s.source = source
3333
s.source_files = "*.{cpp,h}"
3434
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
35-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\"" }
3635
s.header_dir = "jsireact"
36+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
3737
s.xcconfig = { "OTHER_CFLAGS" => "$(inherited) -DRN_TURBO_MODULE_ENABLED" }
3838

3939
s.dependency "React-Core", version
4040
s.dependency "React-cxxreact", version
4141
s.dependency "React-jsi", version
4242
s.dependency "React-turbomodule-core", version
4343
s.dependency "Folly", folly_version
44+
s.dependency "DoubleConversion"
4445

4546
s.subspec "samples-ios" do |ss|
4647
ss.source_files = "platform/ios/*.{mm,cpp,h}"

ReactCommon/yoga/yoga.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Pod::Spec.new do |spec|
4747
source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
4848
spec.source_files = source_files
4949

50-
header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue,YGStyle,CompactValue,YGFloatOptional,Yoga-internal,YGNode,YGConfig,YGLayout,YGMarker}.h'
50+
header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h'
5151
header_files = File.join('ReactCommon/yoga', header_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
5252
spec.public_header_files = header_files
5353
end

0 commit comments

Comments
 (0)