Skip to content

Commit 7867f96

Browse files
committed
Add a test that triggers the StableConfigurationCache bug.
1 parent 018cb66 commit 7867f96

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 DiffPlug
2+
* Copyright 2020-2022 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,8 @@ public class ConfigurationCacheTest extends GradleIntegrationHarness {
2525
@Override
2626
protected GradleRunner gradleRunner() throws IOException {
2727
setFile("gradle.properties").toContent("org.gradle.unsafe.configuration-cache=true");
28-
return super.gradleRunner().withGradleVersion(GradleVersionSupport.CONFIGURATION_CACHE.version);
28+
setFile("settings.gradle").toContent("enableFeaturePreview(\"STABLE_CONFIGURATION_CACHE\")");
29+
return super.gradleRunner().withGradleVersion(GradleVersionSupport.STABLE_CONFIGURATION_CACHE.version);
2930
}
3031

3132
@Test

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public class GradleIntegrationHarness extends ResourceHarness {
4343
public enum GradleVersionSupport {
4444
JRE_11("5.0"), MINIMUM(SpotlessPlugin.MINIMUM_GRADLE),
4545
// technically, this API exists in 6.5, but the flags for it change in 6.6, so we build to that
46-
CONFIGURATION_CACHE("6.6");
46+
CONFIGURATION_CACHE("6.6"),
47+
// https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:stable
48+
STABLE_CONFIGURATION_CACHE("7.5");
4749

4850
final String version;
4951

0 commit comments

Comments
 (0)