fix: pluginJarFiles.from() can accept a Configuration directly. #1311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a bug where local project spotbugs plugins aren't being built when running
spotbugsMain
. Here's our project structure:And then when I run
./gradlew module:spotbugsMain
, the task succeeds, despite violating the rule defined inmy-spotbugs-plugin
. If, however, I add this, then the task fails as expected:which led me to this PR (because that should not be necessary). There were two issues, both of which I had to fix to resolve this issue. First, this idiom is unnecessary and seems to just not work:
that can be simplified to
Note also that I've changed
configurations.getByName()
toconfigurations.named()
to maintain laziness (the latter returns aProvider
).Second, I changed the task input annotation from
@Internal
to@Classpath
. This input is not, in my opinion, internal at all, but an important part of the task input. It also just doesn't work when annotated as an internal property. I suspect some other properties are also improperly marked as internal, but I haven't attempted to confirm this.