Add annotations for compatibility with Gradle 7.0 #283
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 PR won't compile until #282 or similar is merged)
Gradle 7.0 verifies that all the task properties are either inputs or outputs (https://docs.gradle.org/current/userguide/upgrading_version_6.html#task_validation_problems_are_now_errors). From looking at the plugin code I figured all the properties are inputs, although I'm not certain this is 100% correct. For example from what I see
variant: TestVariant
is actually both an input and output, depending on the task, but since the property is declared on the base class it's not a straightforward change to have this accurately annotated.I decided to just add
@Input
annotations everywhere because this will at least make the plugin work again. However, it's only because no task declares outputs, and so up-to-date checks are off. This is desired behavior, because Android's connected check tasks are never up-to-date themselves, so screenshot tasks never being up-to-date makes sense too. But please note this would have to be explicitly declared (e.g. withoutputs.upToDateWhen { false }
or by linking the up-to-date check to connected test task) if any task has an@Output
declared in the future.I verified the fix with
./gradlew validatePlugins
task and by runningrecord
andverify
tasks on my own project with a locally published snapshot (sample doesn't seem to work with Gradle 7 either).Fixes #281