File tree Expand file tree Collapse file tree 1 file changed +32
-2
lines changed
plugin-gradle/src/test/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2016-2024 DiffPlug
2+ * Copyright 2016-2025 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.
1717
1818import java .io .IOException ;
1919
20+ import org .gradle .testkit .runner .GradleRunner ;
2021import org .junit .jupiter .api .Test ;
2122
22- class BumpThisNumberIfACustomStepChangesTest extends GradleIntegrationHarness {
23+ abstract class BumpThisNumberIfACustomStepChangesTest extends GradleIntegrationHarness {
24+ private boolean useConfigCache ;
25+
26+ BumpThisNumberIfACustomStepChangesTest (boolean useConfigCache ) {
27+ this .useConfigCache = useConfigCache ;
28+ }
29+
30+ static class WithConfigCache extends BumpThisNumberIfACustomStepChangesTest {
31+ WithConfigCache () {
32+ super (true );
33+ }
34+ }
35+
36+ static class WithoutConfigCache extends BumpThisNumberIfACustomStepChangesTest {
37+ WithoutConfigCache () {
38+ super (false );
39+ }
40+ }
41+
42+ @ Override
43+ public GradleRunner gradleRunner () throws IOException {
44+ if (useConfigCache ) {
45+ setFile ("gradle.properties" ).toLines ("org.gradle.unsafe.configuration-cache=true" ,
46+ "org.gradle.configuration-cache=true" );
47+ return super .gradleRunner ().withGradleVersion (GradleVersionSupport .CONFIGURATION_CACHE .version );
48+ } else {
49+ return super .gradleRunner ();
50+ }
51+ }
52+
2353 private void writeBuildFile (String toInsert ) throws IOException {
2454 setFile ("build.gradle" ).toLines (
2555 "plugins {" ,
You can’t perform that action at this time.
0 commit comments