diff --git a/README.md b/README.md index 7b4e5493..7f2d7b64 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ You could easily ensure that `docker compose up` is called before your tests but # Usage The plugin must be applied on project that contains `docker-compose.yml` file. It supposes that [Docker Engine](https://docs.docker.com/engine/) and [Docker Compose](https://docs.docker.com/compose/) are installed and available in `PATH`. +> Starting from plugin version _0.17.6_, Gradle 6.1 is required, because _Task.usesService()_ is used. + > Starting from plugin version _0.17.0_, _useDockerComposeV2_ property defaults to _true_, so the new `docker compose` (instead of deprecated `docker-compose` is used). > Starting from plugin version _0.10.0_, Gradle 4.9 or newer is required (because it uses [Task Configuration Avoidance API](https://docs.gradle.org/current/userguide/task_configuration_avoidance.html)). diff --git a/src/main/groovy/com/avast/gradle/dockercompose/TasksConfigurator.groovy b/src/main/groovy/com/avast/gradle/dockercompose/TasksConfigurator.groovy index 56ecd7b6..89c7871d 100644 --- a/src/main/groovy/com/avast/gradle/dockercompose/TasksConfigurator.groovy +++ b/src/main/groovy/com/avast/gradle/dockercompose/TasksConfigurator.groovy @@ -67,11 +67,14 @@ class TasksConfigurator { }) task.dockerExecutor = composeSettings.dockerExecutor task.finalizedBy(downForcedOnFailureTask) + task.usesService(composeExecutor) + task.usesService(serviceInfoCache) } this.buildTask = project.tasks.register(name ? "${name}ComposeBuild".toString() : 'composeBuild', ComposeBuild) {task -> task.buildAdditionalArgs.set(composeSettings.buildAdditionalArgs) task.startedServices.set(composeSettings.startedServices) task.composeExecutor.set(composeExecutor) + task.usesService(composeExecutor) } this.pullTask = project.tasks.register(name ? "${name}ComposePull".toString() : 'composePull', ComposePull) {task -> task.ignorePullFailure.set(composeSettings.ignorePullFailure) @@ -81,15 +84,18 @@ class TasksConfigurator { task.dependsOn(composeSettings.buildBeforePull.map { buildBeforePull -> buildBeforePull ? [buildTask] : [] }) + task.usesService(composeExecutor) } this.logsTask = project.tasks.register(name ? "${name}ComposeLogs".toString() : 'composeLogs', ComposeLogs) {task -> task.containerLogToDir.set(composeSettings.containerLogToDir) task.composeExecutor.set(composeExecutor) + task.usesService(composeExecutor) } this.pushTask = project.tasks.register(name ? "${name}ComposePush".toString() : 'composePush', ComposePush) {task -> task.ignorePushFailure.set(composeSettings.ignorePushFailure) task.pushServices.set(composeSettings.pushServices) task.composeExecutor.set(composeExecutor) + task.usesService(composeExecutor) } } @@ -108,6 +114,8 @@ class TasksConfigurator { task.nestedName.set(composeSettings.nestedName) task.composeExecutor.set(composeExecutor) task.serviceInfoCache.set(serviceInfoCache) + task.usesService(composeExecutor) + task.usesService(serviceInfoCache) } @PackageScope