Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
fix: analysis is broken when classDir has no .class file but others
Browse files Browse the repository at this point in the history
Gradle plugin should ignore other files such as .xml, .txt, .properties
and so on. Only .class files should be considered as the target to
analyse by default.

fix #89
  • Loading branch information
KengoTODA committed Feb 19, 2020
1 parent efcd3ec commit b5a16ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/groovy/com/github/spotbugs/snom/SpotBugsTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ class SpotBugsTask extends DefaultTask implements VerificationTask {
if (getClassDirs() == null) {
throw new InvalidUserDataException("The classDirs property is not set")
}
return getClassDirs().asFileTree
return getClassDirs().asFileTree.filter({ File file ->
file.name.endsWith(".class")
})
} else {
return classes
}
Expand Down

0 comments on commit b5a16ce

Please sign in to comment.