Skip to content

Commit 7401807

Browse files
committed
Fixed: When the target of a Gradle SpotlessTask was reduced (e.g. some generated code was excluded), Spotless could keep giving warnings until cache file was deleted.
1 parent f7dbfce commit 7401807

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

plugin-gradle/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
### Version 3.8.0-SNAPSHOT - TBD ([javadoc](https://diffplug.github.io/spotless/javadoc/snapshot/), [snapshot](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/spotless/spotless-plugin-gradle/))
44

5+
* Bugfix: if the specified target of a spotless task was reduced, Spotless could keep giving warnings until the cache file was deleted.
6+
57
### Version 3.7.0 - December 2nd 2017 ([javadoc](https://diffplug.github.io/spotless/javadoc/spotless-plugin-gradle/3.7.0/), [jcenter](https://bintray.com/diffplug/opensource/spotless-plugin-gradle/3.7.0))
68

79
* Updated default eclipse-jdt version to `4.7.1` from `4.6.3`.

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public void performAction(IncrementalTaskInputs inputs) throws Exception {
183183
if (getCacheFile().exists()) {
184184
LastApply lastApply = SerializableMisc.fromFile(LastApply.class, getCacheFile());
185185
for (File file : lastApply.changedFiles) {
186-
if (!outOfDate.contains(file) && file.exists()) {
186+
if (!outOfDate.contains(file) && file.exists() && Iterables.contains(target, file)) {
187187
outOfDate.add(file);
188188
}
189189
}

0 commit comments

Comments
 (0)