Mike Wacker
11/03/2025, 10:35 PMcomposeUp task for the avast.gradle.docker-compose to run first if the test task is out-of-date, but it (and the composeDown task) should abe skipped if the test task is skipped.
Context: https://github.com/avast/gradle-docker-compose-plugin/issues/453Mike Wacker
11/03/2025, 10:36 PM@PackageScope
void isRequiredByCore(Task task, boolean fromConfigure) {
task.dependsOn upTask
task.finalizedBy downTask
https://github.com/avast/gradle-docker-compose-plugin/blob/560c9f09bdfd7387511bccf[…]/groovy/com/avast/gradle/dockercompose/TasksConfigurator.groovyVampire
11/04/2025, 8:01 AMAdam
11/04/2025, 9:33 AMAdam
11/04/2025, 9:36 AMdocker compose up is to make sure it's only run once per build, right? Or would it be acceptable to run it inside a test task's doFirst {} action?Adam
11/04/2025, 9:47 AMVampire
11/04/2025, 10:44 AMAutoCloseable you do the "down" in the close method which will be called between the last task needing the service and the end of the build.
So even if multiple tasks need the service it only does its "up" once in the build if needed or not and its "down" once in the build when its appropriate.Vampire
11/04/2025, 10:45 AMMike Wacker
11/04/2025, 10:14 PMcomposeUp task with a build service breaks everyone who has a tasks.named("composeUp") configuration block.Vampire
11/05/2025, 7:55 AMdependsOn / finalizedBy sequence.Mike Wacker
11/06/2025, 7:54 PMisRequiredBy() in a dockerCompose block, it registers and configures a fresh set of tasks (e.g., composeUp). Which makes sense, as different projects may be using different docker-compose.yml files.
But here, it sounds like there's a singleton shared build service which is shared across all tasks from all projects.Vampire
11/07/2025, 8:49 AMproject.path within the name of the service to scope it to the project. This also prevents class loader issues when your plugin is applied to individual subprojects without being on a common parent class loader.