Slackbot
09/25/2023, 2:17 PMŁukasz Wasylkowski
09/25/2023, 2:18 PMassemble
tasks, grep the output to determine if they've changed, and only if they did then run the tests. But I'd like to do that as last resort onlyVampire
09/25/2023, 2:37 PMThat's probably not the right thing to do, but more annotating withoutputs.upToDateWhen { false }
@UntrackedTask
or using doNotTrackState()
. Using upToDateWhen { false }
was a work-around for not having that facility in older Gradle versions.
Just a general advice, that doesn't change the actual behavior in your case.
So, what I could say isActually, you cannot say that, because you do not know whether the last timeandverifyScreenshots
are always up to date ifconnectedDebugAndroidTest
andassembleDebug
are up-to-date.assembleDebugAndroidTest
verifyScreenshots
was run is the same time assembleDebug
and assembeeDebugAndroidTest
were run, or whether maybe the outputs of verifyScreenshots
were changed and thus it needs to rerun.
What you could maybe do if you really want to do this is to register a shared build service as OperationCompletionListener
that then records the outcome of the assemble...
tasks and use that build service in the onlyIf
of the verifyScreenshots
task to skip it if the other two tasks were up-to-date.Łukasz Wasylkowski
09/26/2023, 7:37 AMor whether maybe the outputs ofThat's exactly right, but I accept these shortcomings, as I only want to optimize CI 🙂 But I understand there might be false-positives 👍 I'll definitely try thewere changed and thus it needs to rerun.verifyScreenshots
OperationCompletionListener
, thanks!Javi
09/26/2023, 3:16 PMŁukasz Wasylkowski
09/26/2023, 4:25 PMJavi
09/26/2023, 4:34 PMŁukasz Wasylkowski
09/26/2023, 4:43 PM