From b68c88e87ed391fa4408479c4a2a47647017f2d5 Mon Sep 17 00:00:00 2001 From: Toshihiro Nakamura Date: Sun, 29 Sep 2024 09:06:25 +0900 Subject: [PATCH] Replace deprecated APIs --- .../org/seasar/doma/gradle/compile/CompilePlugin.java | 8 ++++---- .../org/seasar/doma/gradle/compile/ConfigureJava.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compile/src/main/java/org/seasar/doma/gradle/compile/CompilePlugin.java b/compile/src/main/java/org/seasar/doma/gradle/compile/CompilePlugin.java index 8aad6f6..502c583 100644 --- a/compile/src/main/java/org/seasar/doma/gradle/compile/CompilePlugin.java +++ b/compile/src/main/java/org/seasar/doma/gradle/compile/CompilePlugin.java @@ -3,7 +3,7 @@ import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.plugins.JavaPlugin; -import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.tasks.SourceSet; public class CompilePlugin implements Plugin { @@ -15,10 +15,10 @@ public void apply(Project project) { .withType( JavaPlugin.class, javaPlugin -> { - JavaPluginConvention javaConvention = - project.getConvention().getPlugin(JavaPluginConvention.class); + JavaPluginExtension javaPluginExtension = + project.getExtensions().getByType(JavaPluginExtension.class); SourceSet mainSourceSet = - javaConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME); + javaPluginExtension.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME); ConfigureJava.configure(project, mainSourceSet); ConfigureKotlin.configure(project, mainSourceSet); }); diff --git a/compile/src/main/java/org/seasar/doma/gradle/compile/ConfigureJava.java b/compile/src/main/java/org/seasar/doma/gradle/compile/ConfigureJava.java index b0d7548..843efbd 100644 --- a/compile/src/main/java/org/seasar/doma/gradle/compile/ConfigureJava.java +++ b/compile/src/main/java/org/seasar/doma/gradle/compile/ConfigureJava.java @@ -21,7 +21,7 @@ public static void configure(Project project, SourceSet sourceSet) { CopyResources.NAME + "Java", CopyResources.class, sourceSet, - javaCompile.getDestinationDir()); + javaCompile.getDestinationDirectory()); javaCompile.dependsOn(copyResources); processResources.configure(task -> task.exclude(CopyResources.DOMA_RESOURCES));