native-build-tools
native-build-tools copied to clipboard
`GFileUtils` is deprecated, maybe use standard JDK APIs instead?
I think this is a very simple issue that is unrelated to OS, Java version, etc. The only relevant information is the Gradle version. I'm using 8.0-rc-2. I have a simple project using this plugin and when I run build with --warning-mode all, Gradle produces the following warning:
The org.gradle.util.GFileUtils type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.0-rc-2/userguide/upgrading_version_7.html#org_gradle_util_reports_deprecations
at org.gradle.util.GFileUtils.logDeprecation(GFileUtils.java:60)
at org.gradle.util.GFileUtils.deleteDirectory(GFileUtils.java:257)
at org.graalvm.buildtools.gradle.NativeImagePlugin$CleanupTestIdsDirectory.execute(NativeImagePlugin.java:829)
at org.graalvm.buildtools.gradle.NativeImagePlugin$CleanupTestIdsDirectory.execute(NativeImagePlugin.java:818)
There is no need of reproduction. I think the deprecation could be found in the source code, and the fix is very simple: just use JDK API to delete directories!
Related code: https://github.com/graalvm/native-build-tools/blob/46524af5711458351a4443ca5473c4cc4fbb150a/common/junit-platform-native/gradle/native-image-testing.gradle#L58