Skip to content

Commit

Permalink
fix: use task creation avoidance api
Browse files Browse the repository at this point in the history
  • Loading branch information
daanschipper authored and KengoTODA committed Apr 29, 2020
1 parent 9959c1c commit 6e2c04e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/groovy/com/github/spotbugs/snom/SpotBugsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.github.spotbugs.snom.internal.SpotBugsTaskFactory;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.plugins.JavaBasePlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -39,8 +39,11 @@ public void apply(Project project) {
javaBase -> {
log.debug(
"The javaBase plugin has been applied, so making the check task depending on all of SpotBugsTask");
Task check = project.getTasks().getByName("check");
project.getTasks().withType(SpotBugsTask.class, check::dependsOn);
project
.getTasks()
.named(JavaBasePlugin.CHECK_TASK_NAME)
.configure(
task -> task.dependsOn(project.getTasks().withType(SpotBugsTask.class)));
});
createTasks(project, extension);
}
Expand Down

0 comments on commit 6e2c04e

Please sign in to comment.