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

Use install_modules_dependencies #5334

Merged
merged 15 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 9 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
31 changes: 3 additions & 28 deletions Example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -505,34 +505,9 @@ PODS:
- RNGestureHandler (2.13.2):
- React-Core
- RNReanimated (3.5.0):
- DoubleConversion
- FBLazyVector
- glog
- hermes-engine
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-callinvoker
- RCT-Folly (= 2021.07.22.00)
- React-Core
- React-Core/DevSupport
- React-Core/RCTWebSocket
- React-CoreModules
- React-cxxreact
- React-hermes
- React-jsi
- React-jsiexecutor
- React-jsinspector
- React-RCTActionSheet
- React-RCTAnimation
- React-RCTAppDelegate
- React-RCTBlob
- React-RCTImage
- React-RCTLinking
- React-RCTNetwork
- React-RCTSettings
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.25.0):
- React-Core
- React-RCTImage
Expand Down Expand Up @@ -798,7 +773,7 @@ SPEC CHECKSUMS:
RNCMaskedView: f7c74478c83c4fdfc5cf4df51f80c0dd5cf125c6
RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8
RNGestureHandler: bb86e378287f7713baf3ca205423eb8109790022
RNReanimated: 7032c33fc6caf259b4872375342b72183c688fc3
RNReanimated: d6138334fbdf0b4ba9a740db9b8caa06c20f38ed
RNScreens: 85d3880b52d34db7b8eeebe2f1a0e807c05e69fa
RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Expand All @@ -807,4 +782,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: f37cea0ea1b6dc523fb88a9c2bdb9993f4b567ce

COCOAPODS: 1.14.0
COCOAPODS: 1.14.2
34 changes: 10 additions & 24 deletions FabricExample/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1153,33 +1153,19 @@ PODS:
- React-RCTFabric
- ReactCommon/turbomodule/core
- RNReanimated (3.5.0):
- DoubleConversion
- FBLazyVector
- glog
- hermes-engine
- RCT-Folly
- RCT-Folly (= 2021.07.22.00)
- RCTRequired
- RCTTypeSafety
- React-callinvoker
- React-Codegen
- React-Core
- React-Core/DevSupport
- React-Core/RCTWebSocket
- React-CoreModules
- React-cxxreact
- React-hermes
- React-jsi
- React-jsiexecutor
- React-jsinspector
- React-RCTActionSheet
- React-RCTAnimation
- React-RCTBlob
- React-debug
- React-Fabric
- React-graphics
- React-NativeModulesApple
- React-RCTFabric
- React-RCTImage
- React-RCTLinking
- React-RCTNetwork
- React-RCTSettings
- React-RCTText
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.25.0):
Expand Down Expand Up @@ -1487,7 +1473,7 @@ SPEC CHECKSUMS:
React-perflogger: e3596db7e753f51766bceadc061936ef1472edc3
React-RCTActionSheet: 17ab132c748b4471012abbcdcf5befe860660485
React-RCTAnimation: c8bbaab62be5817d2a31c36d5f2571e3f7dcf099
React-RCTAppDelegate: d43ecd62e3ff9a8d09eab3a05ce786d160786dfe
React-RCTAppDelegate: 7a68d7f49d93f4899acde16ff5050854602a6ca2
React-RCTBlob: 1bcf3a0341eb8d6950009b1ddb8aefaf46996b8c
React-RCTFabric: 2d72175df6e0e230a13ec2a7eef184ac0a122fd3
React-RCTImage: 670a3486b532292649b1aef3ffddd0b495a5cee4
Expand All @@ -1505,7 +1491,7 @@ SPEC CHECKSUMS:
RNCMaskedView: f7c74478c83c4fdfc5cf4df51f80c0dd5cf125c6
RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8
RNGestureHandler: 039162c42c65de1228c58eb48be90c279bfde3f1
RNReanimated: 87385a5102be3fed4b2ffd4d78ed8b49cb1350cb
RNReanimated: 4b82c89a58f66169352b947403f45b2142e7595b
RNScreens: cba72a26a6c967765a8388fe85f78e7771012ca1
RNSVG: df9aaada196f6a61c8e30dc55d41e6c108a954e7
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Expand All @@ -1514,4 +1500,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 200355ebe627c91121916eeac614c78c24ec30b7

COCOAPODS: 1.14.0
COCOAPODS: 1.14.2
98 changes: 52 additions & 46 deletions RNReanimated.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,29 @@ config = find_config()
assert_latest_react_native_with_new_architecture(config, reanimated_package_json)
assert_minimal_react_native_version(config)

fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
is_release = ENV['PRODUCTION'] == '1'
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'

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
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
boost_compiler_flags = '-Wno-documentation'
fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
fabric_flags = new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
example_flag = config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : ''
version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"]
debug_flag = is_release ? '-DNDEBUG' : ''
ios_min_version = config[:react_native_minor_version] >= 73 ? '10.0' : '9.0'

Pod::Spec.new do |s|

s.name = "RNReanimated"
s.version = reanimated_package_json["version"]
s.summary = reanimated_package_json["description"]
s.description = <<-DESC
RNReanimated
DESC
s.homepage = "https://github.com/software-mansion/react-native-reanimated"
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "author" => "author@domain.cn" }
s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" }
s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" }

s.source_files = [
"apple/**/*.{mm,h,m}",
"Common/cpp/**/*.{cpp,h}"
]

s.preserve_paths = [
"Common/cpp/hidden_headers/**"
]

s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"DEFINES_MODULE" => "YES",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Private/Yoga\"",
"FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
}
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + ' -DHERMES_ENABLE_DEBUGGER'
s.xcconfig = {
"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]}\"",
"OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + example_flag + " " + version_flag + " " + debug_flag
}

s.requires_arc = true
ios_min_version = new_arch_enabled ? '11.0' : config[:react_native_minor_version] >= 73 ? '10.0' : '9.0'
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved

module LegacyModule
def self.install_modules_dependencies(s, config, new_arch_enabled, using_hermes)
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
s.dependency "React-Core"
if fabric_enabled
if new_arch_enabled
s.dependency "React-RCTFabric"
s.dependency "React-Codegen"
end
s.dependency "RCT-Folly"
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
s.dependency 'FBLazyVector'
if config[:react_native_minor_version] <= 71
s.dependency 'FBReactNativeSpec'
Expand Down Expand Up @@ -97,8 +59,52 @@ Pod::Spec.new do |s|
s.dependency 'hermes-engine'
end
s.dependency 'React-callinvoker'

if config[:react_native_minor_version] >= 72 && !fabric_enabled
if config[:react_native_minor_version] >= 72 && !new_arch_enabled
s.dependency 'React-RCTAppDelegate'
end
end
end

Pod::Spec.new do |s|

s.name = "RNReanimated"
s.version = reanimated_package_json["version"]
s.summary = reanimated_package_json["description"]
s.description = <<-DESC
RNReanimated
DESC
s.homepage = "https://github.com/software-mansion/react-native-reanimated"
s.license = "MIT"
s.author = { "author" => "author@domain.cn" }
s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" }
s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" }

s.source_files = [
"apple/**/*.{mm,h,m}",
"Common/cpp/**/*.{cpp,h}"
]

s.preserve_paths = [
"Common/cpp/hidden_headers/**"
]

s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"DEFINES_MODULE" => "YES",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Private/Yoga\"",
"FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
}
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + ' -DHERMES_ENABLE_DEBUGGER'
s.xcconfig = {
"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]}\"",
"OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + example_flag + " " + version_flag + " " + debug_flag
}
s.requires_arc = true
s.dependency "ReactCommon/turbomodule/core"
tomekzaw marked this conversation as resolved.
Show resolved Hide resolved
if defined?(install_modules_dependencies()) != nil
install_modules_dependencies(s)
else
LegacyModule.install_modules_dependencies(s, config, new_arch_enabled, using_hermes)
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
end
end