Slackbot
05/19/2023, 11:09 AMAdam
05/19/2023, 3:41 PMAdam
05/19/2023, 3:45 PMtasks.test.configure {
val imageName = "my-image"
inputs.property("dockerImageHash",
providers.exec {
executable("docker")
args(parseSpaceSeparatedArgs("inspect --format='{{index .RepoDigests 0}}' $imageName"))
}.standardOutput.asText)
}
}
Nikolay
05/19/2023, 3:48 PMAdam
05/19/2023, 3:50 PMAdam
05/19/2023, 3:50 PMAdam
05/19/2023, 3:57 PMval intTestUpToDateCheck by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
}
dependencies {
intTestUpToDateCheck(project(":my-service"))
}
tasks.test.configure {
inputs.files(intTestUpToDateCheck)
}
(writing by hand - the syntax might need some work)
that way if my-service
changes then the task will re-run, but because the dependency isn’t used for anything else the files won’t be visible in the source codeNikolay
05/19/2023, 4:38 PMNikolay
05/19/2023, 4:38 PM