Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions apps/fabric-example/ios/Podfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#!/bin/bash

COMPILE_COMMANDS_PATH="../../../compile_commands.json"
COMPILE_COMMANDS_REANIMATED_PATH="../../../packages/react-native-reanimated/compile_commands.json"
COMPILE_COMMANDS_WORKLETS_PATH="../../../packages/react-native-worklets/compile_commands.json"
COMPILATION_DATABASE_PATH="**/CompilationDatabase"

echo "[" >$COMPILE_COMMANDS_PATH
for f in **/CompilationDatabase/*.json; do cat "$f" >>$COMPILE_COMMANDS_PATH; done
echo "]" >>$COMPILE_COMMANDS_PATH

echo "Generated clangd metadata."
out="$COMPILE_COMMANDS_REANIMATED_PATH"

printf "[\n" > "$out"
cat $COMPILATION_DATABASE_PATH/*.json >> "$out"

sed '$ s/,$//' "$out" > "$out.tmp"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simply remove the last character instead of seding? Or is it the simplest approach to remove the last character?

mv "$out.tmp" "$out"

printf "]" >> "$out"

cp "$COMPILE_COMMANDS_REANIMATED_PATH" "$COMPILE_COMMANDS_WORKLETS_PATH"


echo "Generated clangd metadata."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing newline

Suggested change
echo "Generated clangd metadata."
echo "Generated clangd metadata."

8 changes: 7 additions & 1 deletion packages/react-native-worklets/RNWorklets.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ worklets_assert_new_architecture_enabled($new_arch_enabled)

ios_min_version = '13.4'

# Directory in which data for further processing for clangd will be stored.
compilation_metadata_dir = "CompilationDatabase"
# We want generate the metadata only within the monorepo of Reanimated.
compilation_metadata_generation_flag = $config[:is_reanimated_example_app] ? "-gen-cdb-fragment-path #{compilation_metadata_dir}" : ''


feature_flags = $worklets_config[:feature_flags_flag]
version_flags = "-DWORKLETS_VERSION=#{package['version']} -DREACT_NATIVE_MINOR_VERSION=#{$worklets_config[:react_native_minor_version]}"
worklets_profiling_flag = ENV['IS_WORKLETS_PROFILING'] ? '-DWORKLETS_PROFILING' : ''
Expand Down Expand Up @@ -75,7 +81,7 @@ Pod::Spec.new do |s|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
"GCC_PREPROCESSOR_DEFINITIONS[config=*Debug*]" => "$(inherited) #{hermes_debug_hidden_flags}",
"GCC_PREPROCESSOR_DEFINITIONS[config=*Release*]" => "$(inherited)",
"OTHER_CFLAGS" => "$(inherited) #{feature_flags} #{version_flags} #{worklets_profiling_flag} #{fetch_preview_flag} #{hermes_v1_flag}",
"OTHER_CFLAGS" => "$(inherited) #{feature_flags} #{version_flags} #{compilation_metadata_generation_flag} #{worklets_profiling_flag} #{fetch_preview_flag} #{hermes_v1_flag}",
}
s.xcconfig = {
"HEADER_SEARCH_PATHS" => [
Expand Down
Loading