From 5cb23aeb857e62272c950815d1a05bf7b798aaf6 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Sat, 10 Sep 2022 07:47:19 +0100 Subject: [PATCH] Only disable test tasks when a project isn't compatible with toolchain Disabling compilation means that any downstream project will break. For example, disabling our Gradle plugin's compileJava task means that the launch script test app fails to build as it uses our Gradle plugin and its classes are missing. See gh-gh-32280 --- .../springframework/boot/build/toolchain/ToolchainPlugin.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/toolchain/ToolchainPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/toolchain/ToolchainPlugin.java index e67cf09a74..395209c81a 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/toolchain/ToolchainPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/toolchain/ToolchainPlugin.java @@ -23,8 +23,6 @@ import java.util.List; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.plugins.JavaPluginExtension; -import org.gradle.api.tasks.compile.JavaCompile; -import org.gradle.api.tasks.javadoc.Javadoc; import org.gradle.api.tasks.testing.Test; import org.gradle.jvm.toolchain.JavaLanguageVersion; import org.gradle.jvm.toolchain.JavaToolchainSpec; @@ -67,8 +65,6 @@ public class ToolchainPlugin implements Plugin { } private void disableToolchainTasks(Project project) { - project.getTasks().withType(JavaCompile.class, (task) -> task.setEnabled(false)); - project.getTasks().withType(Javadoc.class, (task) -> task.setEnabled(false)); project.getTasks().withType(Test.class, (task) -> task.setEnabled(false)); }