Skip to content

Commit c95574f

Browse files
committed
jvmLocalCache was failing on Java 21 because the trick we used to test JvmLocalCache doesn't work with Gradle 8.5.
1 parent f2cc906 commit c95574f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ConfigurationCacheTest.java

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import org.gradle.testkit.runner.BuildResult;
2121
import org.gradle.testkit.runner.GradleRunner;
2222
import org.junit.jupiter.api.Test;
23+
import org.junit.jupiter.api.condition.EnabledForJreRange;
24+
import org.junit.jupiter.api.condition.JRE;
2325

2426
public class ConfigurationCacheTest extends GradleIntegrationHarness {
2527
@Override
@@ -63,6 +65,7 @@ public void helpConfiguresIfTasksAreCreated() throws IOException {
6365
}
6466

6567
@Test
68+
@EnabledForJreRange(max = JRE.JAVA_20)
6669
public void jvmLocalCache() throws IOException {
6770
setFile("build.gradle").toLines(
6871
"plugins {",
@@ -91,6 +94,10 @@ public void jvmLocalCache() throws IOException {
9194
gradleRunner().withArguments("spotlessApply").build();
9295
assertFile("test.java").sameAsResource("java/googlejavaformat/JavaCodeFormatted.test");
9396

97+
// the withDebug forces it to start a new deamon, but only in Gradle 8.3 and older
98+
// starting with Gradle 8.5 this doesn't work anymore
99+
// and we need Gradle 8.5 for Java 21
100+
// so we can't test this on Java 21 for now
94101
BuildResult failure = gradleRunner().withDebug(true).withArguments("spotlessApply", "--stacktrace").buildAndFail();
95102
failure.getOutput().contains("Spotless daemon-local cache is stale. Regenerate the cache with\n" +
96103
" rm -rf .gradle/configuration-cache\n" +

0 commit comments

Comments
 (0)