Closed lwasyl closed 3 years ago
@xiphirx could we get this one too to complement https://github.com/facebook/screenshot-tests-for-android/pull/282 ?
@xiphirx has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@xiphirx merged this pull request in facebook/screenshot-tests-for-android@081522d74a547c80c4798fd24c5ff516872ef959.
(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