Skip to content

Commit

Permalink
Expose worklets as prefab (#6372)
Browse files Browse the repository at this point in the history
## Summary

This PR fixes existing prefab integration and extends it for
`libworklets.so` along with its header files.

## Test plan

I have personally tested out these changes in
react-native-live-markdown.
  • Loading branch information
tomekzaw authored Aug 5, 2024
1 parent 7df5fd5 commit b28f779
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/react-native-reanimated/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ android {
reanimated {
headers prefabHeadersDir.absolutePath
}
worklets {
headers prefabHeadersDir.absolutePath
}
}

defaultConfig {
Expand Down Expand Up @@ -428,14 +431,14 @@ def assertMinimalReactNativeVersion = task assertMinimalReactNativeVersionTask {

task prepareHeadersForPrefab(type: Copy) {
from("$projectDir/src/main/cpp")
from("$projectDir/../Common/cpp/AnimatedSensor")
from("$projectDir/../Common/cpp/Fabric")
from("$projectDir/../Common/cpp/LayoutAnimations")
from("$projectDir/../Common/cpp/NativeModules")
from("$projectDir/../Common/cpp/ReanimatedRuntime")
from("$projectDir/../Common/cpp/Registries")
from("$projectDir/../Common/cpp/SharedItems")
from("$projectDir/../Common/cpp/Tools")
from("$projectDir/../Common/cpp/reanimated/AnimatedSensor")
from("$projectDir/../Common/cpp/reanimated/Fabric")
from("$projectDir/../Common/cpp/reanimated/LayoutAnimations")
from("$projectDir/../Common/cpp/reanimated/NativeModules")
from("$projectDir/../Common/cpp/worklets/Registries")
from("$projectDir/../Common/cpp/worklets/SharedItems")
from("$projectDir/../Common/cpp/worklets/Tools")
from("$projectDir/../Common/cpp/worklets/WorkletRuntime")
include("*.h")
into(prefabHeadersDir)
}
Expand Down Expand Up @@ -487,6 +490,7 @@ def resolveTaskFactory(String taskName, String artifactLocalName, File reactNati
task packageNdkLibs(type: Copy) {
from("$buildDir/reanimated-ndk/all")
include("**/libreanimated.so")
include("**/libworklets.so")
into("$projectDir/src/main/jniLibs")
}

Expand Down

0 comments on commit b28f779

Please sign in to comment.