New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not resolve classes dirs as a file tree #2102
Conversation
This causes us to include resources in a way that causes FindBugs to produce an annoying error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch with only taking class files into account for up to date checks. I a comments regarding naming and javadocs.
@@ -328,12 +329,26 @@ public FileTree getSource() { | |||
@SkipWhenEmpty | |||
@PathSensitive(PathSensitivity.RELATIVE) | |||
@InputFiles | |||
public FileCollection getCandidateClasses() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A javadoc would be nice here.
We have getCandidateClassFiles()
on the Test
task. Should we use the same name here?
Should we make this method protected
so we somewhat hide it for consumers of the class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The javadoc is hidden in the diff.
But on second thought about this, I think filtering by .class
files might be wrong here. I think nothing stops someone from doing something like:
findbugsMain {
classes = files("someJar.jar")
}
And this would work. I took your advice and renamed the method and made it less visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch with only taking class files into account for up to date checks. I added a comments regarding naming and javadocs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment. I would now remove the new method completely.
@@ -328,12 +328,21 @@ public FileTree getSource() { | |||
@SkipWhenEmpty | |||
@PathSensitive(PathSensitivity.RELATIVE) | |||
@InputFiles | |||
protected FileCollection getCandidateClassFiles() { | |||
return getClasses().getAsFileTree(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this now different to annotating getClasses
directly? If we do not filter by *.class
then I would actually not add this new method but just use the old method as is and only change the convention mapping.
LGTM! |
This causes us to include resources in a way that causes FindBugs to
produce an annoying error message
Context
Contributor Checklist
internal
package) or updates to > 20 files<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew quickCheck <impacted-subproject>:check
Gradle Core Team Checklist
@since
and@Incubating
annotations for all public APIs