Skip to content

Commit

Permalink
Set the java launcher for Checkstyle tasks, too (#2351)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-baker authored Aug 8, 2022
1 parent cee1889 commit 4405aec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-2351.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Set the java launcher for Checkstyle tasks, too
links:
- https://github.com/palantir/gradle-baseline/pull/2351
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.plugins.quality.Checkstyle;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.CacheableTask;
Expand Down Expand Up @@ -131,6 +132,13 @@ public void execute(Task task) {
}
});

project.getTasks().withType(Checkstyle.class).configureEach(new Action<Checkstyle>() {
@Override
public void execute(Checkstyle checkstyle) {
checkstyle.getJavaLauncher().set(javaToolchain.flatMap(BaselineJavaToolchain::javaLauncher));
}
});

project.getTasks().withType(GroovyCompile.class).configureEach(new Action<GroovyCompile>() {
@Override
public void execute(GroovyCompile groovyCompileTask) {
Expand Down

0 comments on commit 4405aec

Please sign in to comment.