Fix: Remove deprecated project.projectDir usage in android-hook.gradle.kts#9651
Open
benjaminpeters wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I was seeing
react-native-worklets/android/build.gradle.kts:281:36: 'getter for buildDir: File!' is deprecated. Deprecated in Javawhile running react-native-worklets 0.9.1This PR will fix it so it isn't run during configuration - I still think its a good idea to replace deprecated project.projectDir calls with project.layout.projectDirectory.asFile to use the modern Gradle API. This addresses deprecation warnings and ensures compatibility with newer Gradle versions.
Test plan
Build System Verification
and release configurations
generated at the new path by checking that build/prefab-headers/worklets/ contains the
expected header files after build
worklets library is properly linked
correctly with the changes
Cross-Platform Testing
stable version
project supports
Backwards Compatibility
continue to build without issues
configurations
Validation Steps
Verify the prefab headers are generated correctly
./gradlew :react-native-worklets:prepareWorkletsHeadersForPrefabs
ls -la packages/react-native-worklets/android/build/prefab-headers/worklets/
Check that the path is correctly used in CMake
./gradlew :react-native-worklets:externalNativeBuildDebug --info | grep "prefab-headers"
This test plan covers the key areas that could be affected by changing from the deprecated
buildDir to layout.buildDirectory.get().asFile, ensuring the build system continues to
work correctly across different environments.