File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
main/java/com/diffplug/gradle/spotless
test/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,8 @@ public void performAction(InputChanges inputs) throws Exception {
83
83
}
84
84
}
85
85
} else {
86
- throw new GradleException ("Spotless doesn't support configuration cache yet" );
86
+ throw new GradleException ("Spotless doesn't support configuration cache yet.\n " +
87
+ "Rerun with --no-configuration-cache" );
87
88
}
88
89
}
89
90
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .diffplug .gradle .spotless ;
17
17
18
+ import java .io .File ;
18
19
import java .io .IOException ;
20
+ import java .nio .file .Files ;
21
+ import java .nio .file .Path ;
22
+ import java .util .Comparator ;
19
23
20
24
import org .gradle .testkit .runner .BuildResult ;
21
25
import org .gradle .testkit .runner .GradleRunner ;
@@ -84,5 +88,19 @@ public void gjf() throws IOException {
84
88
// but the second fails
85
89
BuildResult failure = gradleRunner ().withArguments ("spotlessApply" ).buildAndFail ();
86
90
failure .getOutput ().contains ("> Spotless doesn't support configuration cache yet" );
91
+
92
+ // and it will keep failing forever
93
+ gradleRunner ().withArguments ("spotlessApply" ).buildAndFail ();
94
+
95
+ // until you delete the .gradlle/configuration-cache folder
96
+ File configCache = new File (super .rootFolder (), ".gradle/configuration-cache" );
97
+ Files .walk (configCache .toPath ())
98
+ .sorted (Comparator .reverseOrder ())
99
+ .map (Path ::toFile )
100
+ .forEach (File ::delete );
101
+
102
+ // then it will work again (but only once)
103
+ gradleRunner ().withArguments ("spotlessApply" ).build ();
104
+ gradleRunner ().withArguments ("spotlessApply" ).buildAndFail ();
87
105
}
88
106
}
You can’t perform that action at this time.
0 commit comments