Skip to content
Merged
Changes from all 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
8 changes: 4 additions & 4 deletions RNLiveMarkdown.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ react_native_minor_version = react_native_json['version'].split('.')[1].to_i

pods_root = Pod::Config.instance.project_pods_root

worklets_installed = system(%Q[
cd "#{Pod::Config.instance.installation_root}" &&
node -e "require.resolve('react-native-worklets/package.json')" > /dev/null 2>&1
])
react_native_worklets_path = `cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native-worklets/package.json')"`
worklets_installed = react_native_worklets_path != ""
worklets_package_name = worklets_installed ? 'react-native-worklets' : 'react-native-reanimated'
Expand All @@ -18,6 +14,9 @@ react_native_worklets_or_reanimated_node_modules_dir = ENV['REACT_NATIVE_WORKLET
File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('#{worklets_package_name}/package.json')"`)
react_native_worklets_or_reanimated_node_modules_dir_from_pods_root = Pathname.new(react_native_worklets_or_reanimated_node_modules_dir).relative_path_from(pods_root).to_s

react_native_react_common_dir = File.join(react_native_node_modules_dir, 'react-native/ReactCommon')
react_native_react_common_dir_from_pods_root = Pathname.new(react_native_react_common_dir).relative_path_from(pods_root).to_s

package = JSON.parse(File.read(File.join(__dir__, "package.json")))
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'

Expand Down Expand Up @@ -45,6 +44,7 @@ Pod::Spec.new do |s|
"HEADER_SEARCH_PATHS" => [
"\"$(PODS_ROOT)/#{react_native_worklets_or_reanimated_node_modules_dir_from_pods_root}/apple\"",
"\"$(PODS_ROOT)/#{react_native_worklets_or_reanimated_node_modules_dir_from_pods_root}/Common/cpp\"",
"\"$(PODS_ROOT)/#{react_native_react_common_dir_from_pods_root}\"",
].join(' '),
}
if worklets_installed
Expand Down
Loading