native-build-tools icon indicating copy to clipboard operation
native-build-tools copied to clipboard

Deprecation warnings with Gradle 8.2-rc-1

Open wilkinsona opened this issue 2 years ago • 1 comments

I'm not sure that this is really a bug but it didn't feel like a feature request either.

Using the Gradle plugin with Gradle 8.2-rc-1 results in the following deprecation warning:

The Project.getConvention() method 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.2-rc-1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
	at org.gradle.api.internal.project.DefaultProject.getConvention(DefaultProject.java:593)
	at org.graalvm.buildtools.gradle.NativeImagePlugin.configureJavaProject(NativeImagePlugin.java:264)
	at org.graalvm.buildtools.gradle.NativeImagePlugin.lambda$apply$0(NativeImagePlugin.java:201)

Given the Gradle 7.4 baseline, it looks like project.getExtensions().getByType(JavaPluginExtension.class) and JavaPluginExtension.getSourceSets() can be used as a direct replacement for the current JavaPluginConvention usage:

https://github.com/graalvm/native-build-tools/blob/71c741a173c6c08e7d97c29d857babdcb10f350d/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/NativeImagePlugin.java#L263-L264

wilkinsona avatar Jun 02 '23 13:06 wilkinsona

Fixed by #522.

scottfrederick avatar Apr 22 '24 18:04 scottfrederick