Skip to content

Commit

Permalink
jvmLocalCache was failing on Java 21 because the trick we used to t…
Browse files Browse the repository at this point in the history
…est JvmLocalCache doesn't work with Gradle 8.5.
  • Loading branch information
nedtwigg committed Dec 3, 2023
1 parent f2cc906 commit c95574f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.GradleRunner;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.JRE;

public class ConfigurationCacheTest extends GradleIntegrationHarness {
@Override
Expand Down Expand Up @@ -63,6 +65,7 @@ public void helpConfiguresIfTasksAreCreated() throws IOException {
}

@Test
@EnabledForJreRange(max = JRE.JAVA_20)
public void jvmLocalCache() throws IOException {
setFile("build.gradle").toLines(
"plugins {",
Expand Down Expand Up @@ -91,6 +94,10 @@ public void jvmLocalCache() throws IOException {
gradleRunner().withArguments("spotlessApply").build();
assertFile("test.java").sameAsResource("java/googlejavaformat/JavaCodeFormatted.test");

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

0 comments on commit c95574f

Please sign in to comment.