diff --git a/docs/src/docs/asciidoc/index.adoc b/docs/src/docs/asciidoc/index.adoc index 39ea81ccd..f32e4ca31 100644 --- a/docs/src/docs/asciidoc/index.adoc +++ b/docs/src/docs/asciidoc/index.adoc @@ -24,6 +24,10 @@ If you are using alternative build systems, see < // Register Native Image tasks TaskContainer tasks = project.getTasks(); - JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class); + JavaPluginExtension javaConvention = project.getExtensions().getByType(JavaPluginExtension.class); configureAutomaticTaskCreation(project, graalExtension, tasks, javaConvention.getSourceSets()); TaskProvider imageBuilder = tasks.named(NATIVE_COMPILE_TASK_NAME, BuildNativeImageTask.class); diff --git a/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/internal/GradleUtils.java b/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/internal/GradleUtils.java index d60c72578..6d998da56 100644 --- a/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/internal/GradleUtils.java +++ b/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/internal/GradleUtils.java @@ -47,7 +47,7 @@ import org.gradle.api.file.ConfigurableFileCollection; import org.gradle.api.file.FileCollection; import org.gradle.api.plugins.JavaPlugin; -import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.util.GradleVersion; @@ -64,8 +64,8 @@ public static SourceSet findSourceSet(Project project, String sourceSetName) { return sourceSetContainer.findByName(sourceSetName); } - public static JavaPluginConvention getJavaPluginConvention(Project project) { - return project.getConvention().getPlugin(JavaPluginConvention.class); + public static JavaPluginExtension getJavaPluginConvention(Project project) { + return project.getExtensions().getByType(JavaPluginExtension.class); }