Skip to content

Commit 558cce7

Browse files
piaskowyktomekzaw
authored andcommitted
Use install_modules_dependencies (#5334)
## Summary Based on the changes in our libraries mentioned in this PR (software-mansion/react-native-gesture-handler#2635), we need to make adjustments to our `.podspec` file. We should utilize the `install_modules_dependencies` feature available in React Native since version 0.72. Backward compatibility: <img width="126" alt="image" src="https://github.com/software-mansion/react-native-reanimated/assets/36106620/ce5c1c67-8251-47d6-8d4b-98c959a4dfb8"> ## Test plan Check CI --------- Co-authored-by: Tomek Zawadzki <tomasz.zawadzki@swmansion.com>
1 parent f71c01e commit 558cce7

File tree

3 files changed

+71
-106
lines changed

3 files changed

+71
-106
lines changed

Example/ios/Podfile.lock

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -505,34 +505,9 @@ PODS:
505505
- RNGestureHandler (2.13.2):
506506
- React-Core
507507
- RNReanimated (3.5.0):
508-
- DoubleConversion
509-
- FBLazyVector
510-
- glog
511-
- hermes-engine
512-
- RCT-Folly
513-
- RCTRequired
514-
- RCTTypeSafety
515-
- React-callinvoker
508+
- RCT-Folly (= 2021.07.22.00)
516509
- React-Core
517-
- React-Core/DevSupport
518-
- React-Core/RCTWebSocket
519-
- React-CoreModules
520-
- React-cxxreact
521-
- React-hermes
522-
- React-jsi
523-
- React-jsiexecutor
524-
- React-jsinspector
525-
- React-RCTActionSheet
526-
- React-RCTAnimation
527-
- React-RCTAppDelegate
528-
- React-RCTBlob
529-
- React-RCTImage
530-
- React-RCTLinking
531-
- React-RCTNetwork
532-
- React-RCTSettings
533-
- React-RCTText
534510
- ReactCommon/turbomodule/core
535-
- Yoga
536511
- RNScreens (3.25.0):
537512
- React-Core
538513
- React-RCTImage
@@ -798,7 +773,7 @@ SPEC CHECKSUMS:
798773
RNCMaskedView: f7c74478c83c4fdfc5cf4df51f80c0dd5cf125c6
799774
RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8
800775
RNGestureHandler: bb86e378287f7713baf3ca205423eb8109790022
801-
RNReanimated: 7032c33fc6caf259b4872375342b72183c688fc3
776+
RNReanimated: d6138334fbdf0b4ba9a740db9b8caa06c20f38ed
802777
RNScreens: 85d3880b52d34db7b8eeebe2f1a0e807c05e69fa
803778
RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396
804779
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
@@ -807,4 +782,4 @@ SPEC CHECKSUMS:
807782

808783
PODFILE CHECKSUM: f37cea0ea1b6dc523fb88a9c2bdb9993f4b567ce
809784

810-
COCOAPODS: 1.14.0
785+
COCOAPODS: 1.14.2

FabricExample/ios/Podfile.lock

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,33 +1153,19 @@ PODS:
11531153
- React-RCTFabric
11541154
- ReactCommon/turbomodule/core
11551155
- RNReanimated (3.5.0):
1156-
- DoubleConversion
1157-
- FBLazyVector
1158-
- glog
11591156
- hermes-engine
1160-
- RCT-Folly
1157+
- RCT-Folly (= 2021.07.22.00)
11611158
- RCTRequired
11621159
- RCTTypeSafety
1163-
- React-callinvoker
11641160
- React-Codegen
11651161
- React-Core
1166-
- React-Core/DevSupport
1167-
- React-Core/RCTWebSocket
1168-
- React-CoreModules
1169-
- React-cxxreact
1170-
- React-hermes
1171-
- React-jsi
1172-
- React-jsiexecutor
1173-
- React-jsinspector
1174-
- React-RCTActionSheet
1175-
- React-RCTAnimation
1176-
- React-RCTBlob
1162+
- React-debug
1163+
- React-Fabric
1164+
- React-graphics
1165+
- React-NativeModulesApple
11771166
- React-RCTFabric
1178-
- React-RCTImage
1179-
- React-RCTLinking
1180-
- React-RCTNetwork
1181-
- React-RCTSettings
1182-
- React-RCTText
1167+
- React-utils
1168+
- ReactCommon/turbomodule/bridging
11831169
- ReactCommon/turbomodule/core
11841170
- Yoga
11851171
- RNScreens (3.25.0):
@@ -1487,7 +1473,7 @@ SPEC CHECKSUMS:
14871473
React-perflogger: e3596db7e753f51766bceadc061936ef1472edc3
14881474
React-RCTActionSheet: 17ab132c748b4471012abbcdcf5befe860660485
14891475
React-RCTAnimation: c8bbaab62be5817d2a31c36d5f2571e3f7dcf099
1490-
React-RCTAppDelegate: d43ecd62e3ff9a8d09eab3a05ce786d160786dfe
1476+
React-RCTAppDelegate: 7a68d7f49d93f4899acde16ff5050854602a6ca2
14911477
React-RCTBlob: 1bcf3a0341eb8d6950009b1ddb8aefaf46996b8c
14921478
React-RCTFabric: 2d72175df6e0e230a13ec2a7eef184ac0a122fd3
14931479
React-RCTImage: 670a3486b532292649b1aef3ffddd0b495a5cee4
@@ -1505,7 +1491,7 @@ SPEC CHECKSUMS:
15051491
RNCMaskedView: f7c74478c83c4fdfc5cf4df51f80c0dd5cf125c6
15061492
RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8
15071493
RNGestureHandler: 039162c42c65de1228c58eb48be90c279bfde3f1
1508-
RNReanimated: 87385a5102be3fed4b2ffd4d78ed8b49cb1350cb
1494+
RNReanimated: 4b82c89a58f66169352b947403f45b2142e7595b
15091495
RNScreens: cba72a26a6c967765a8388fe85f78e7771012ca1
15101496
RNSVG: df9aaada196f6a61c8e30dc55d41e6c108a954e7
15111497
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
@@ -1514,4 +1500,4 @@ SPEC CHECKSUMS:
15141500

15151501
PODFILE CHECKSUM: 200355ebe627c91121916eeac614c78c24ec30b7
15161502

1517-
COCOAPODS: 1.14.0
1503+
COCOAPODS: 1.14.2

RNReanimated.podspec

Lines changed: 58 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,66 @@ require "json"
22
require_relative './scripts/reanimated_utils'
33

44
reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json")))
5-
config = find_config()
6-
assert_latest_react_native_with_new_architecture(config, reanimated_package_json)
7-
assert_minimal_react_native_version(config)
5+
$config = find_config()
6+
assert_latest_react_native_with_new_architecture($config, reanimated_package_json)
7+
assert_minimal_react_native_version($config)
88

9-
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
9+
$new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
1010
is_release = ENV['PRODUCTION'] == '1'
11-
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
1211

13-
folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + config[:react_native_minor_version].to_s
12+
folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + $config[:react_native_minor_version].to_s
1413
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
1514
boost_compiler_flags = '-Wno-documentation'
16-
fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
17-
example_flag = config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : ''
15+
fabric_flags = $new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
16+
example_flag = $config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : ''
1817
version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"]
1918
debug_flag = is_release ? '-DNDEBUG' : ''
20-
ios_min_version = config[:react_native_minor_version] >= 73 ? '10.0' : '9.0'
19+
ios_min_version = $config[:react_native_minor_version] >= 73 ? '13.4' : '9.0'
20+
21+
def self.install_modules_dependencies_legacy(s)
22+
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
23+
s.dependency "React-Core"
24+
if $new_arch_enabled
25+
s.dependency "React-RCTFabric"
26+
s.dependency "React-Codegen"
27+
end
28+
s.dependency "RCT-Folly"
29+
s.dependency "RCTRequired"
30+
s.dependency "RCTTypeSafety"
31+
s.dependency 'FBLazyVector'
32+
if $config[:react_native_minor_version] <= 71
33+
s.dependency 'FBReactNativeSpec'
34+
end
35+
s.dependency 'React-Core'
36+
s.dependency 'React-CoreModules'
37+
s.dependency 'React-Core/DevSupport'
38+
if !$config[:is_tvos_target]
39+
s.dependency 'React-RCTActionSheet'
40+
end
41+
s.dependency 'React-RCTNetwork'
42+
s.dependency 'React-RCTAnimation'
43+
s.dependency 'React-RCTLinking'
44+
s.dependency 'React-RCTBlob'
45+
s.dependency 'React-RCTSettings'
46+
s.dependency 'React-RCTText'
47+
s.dependency 'React-RCTImage'
48+
s.dependency 'React-Core/RCTWebSocket'
49+
s.dependency 'React-cxxreact'
50+
s.dependency 'React-jsi'
51+
s.dependency 'React-jsiexecutor'
52+
s.dependency 'React-jsinspector'
53+
s.dependency 'Yoga'
54+
s.dependency 'DoubleConversion'
55+
s.dependency 'glog'
56+
if using_hermes && !$config[:is_tvos_target] && $config[:react_native_minor_version] >= 70
57+
s.dependency 'React-hermes'
58+
s.dependency 'hermes-engine'
59+
end
60+
s.dependency 'React-callinvoker'
61+
if $config[:react_native_minor_version] >= 72 && !$new_arch_enabled
62+
s.dependency 'React-RCTAppDelegate'
63+
end
64+
end
2165

2266
Pod::Spec.new do |s|
2367

@@ -29,7 +73,6 @@ Pod::Spec.new do |s|
2973
DESC
3074
s.homepage = "https://github.com/software-mansion/react-native-reanimated"
3175
s.license = "MIT"
32-
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
3376
s.author = { "author" => "author@domain.cn" }
3477
s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" }
3578
s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" }
@@ -53,53 +96,14 @@ Pod::Spec.new do |s|
5396
}
5497
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + ' -DHERMES_ENABLE_DEBUGGER'
5598
s.xcconfig = {
56-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{config[:react_native_common_dir]}\"",
99+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{$config[:react_native_common_dir]}\"",
57100
"OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + example_flag + " " + version_flag + " " + debug_flag
58101
}
59-
60102
s.requires_arc = true
61-
62-
s.dependency "React-Core"
63-
if fabric_enabled
64-
s.dependency "React-RCTFabric"
65-
s.dependency "React-Codegen"
66-
end
67-
s.dependency "RCT-Folly"
68-
s.dependency "RCTRequired"
69-
s.dependency "RCTTypeSafety"
70103
s.dependency "ReactCommon/turbomodule/core"
71-
s.dependency 'FBLazyVector'
72-
if config[:react_native_minor_version] <= 71
73-
s.dependency 'FBReactNativeSpec'
74-
end
75-
s.dependency 'React-Core'
76-
s.dependency 'React-CoreModules'
77-
s.dependency 'React-Core/DevSupport'
78-
if !config[:is_tvos_target]
79-
s.dependency 'React-RCTActionSheet'
80-
end
81-
s.dependency 'React-RCTNetwork'
82-
s.dependency 'React-RCTAnimation'
83-
s.dependency 'React-RCTLinking'
84-
s.dependency 'React-RCTBlob'
85-
s.dependency 'React-RCTSettings'
86-
s.dependency 'React-RCTText'
87-
s.dependency 'React-RCTImage'
88-
s.dependency 'React-Core/RCTWebSocket'
89-
s.dependency 'React-cxxreact'
90-
s.dependency 'React-jsi'
91-
s.dependency 'React-jsiexecutor'
92-
s.dependency 'React-jsinspector'
93-
s.dependency 'Yoga'
94-
s.dependency 'DoubleConversion'
95-
s.dependency 'glog'
96-
if using_hermes && !config[:is_tvos_target] && config[:react_native_minor_version] >= 70
97-
s.dependency 'React-hermes'
98-
s.dependency 'hermes-engine'
99-
end
100-
s.dependency 'React-callinvoker'
101-
102-
if config[:react_native_minor_version] >= 72 && !fabric_enabled
103-
s.dependency 'React-RCTAppDelegate'
104+
if defined?(install_modules_dependencies()) != nil
105+
install_modules_dependencies(s)
106+
else
107+
install_modules_dependencies_legacy(s)
104108
end
105109
end

0 commit comments

Comments
 (0)