From 33cb6711f485b11fee3879dbeaf8c0a6a9ff2fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20August=C3=BDn?= Date: Thu, 30 Jun 2022 21:29:25 +0200 Subject: [PATCH] feat: setProjectName accepts null or empty value as reset Fixes #362 --- .../avast/gradle/dockercompose/ComposeSettings.groovy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy b/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy index dfd5d8ed..95eda450 100644 --- a/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy +++ b/src/main/groovy/com/avast/gradle/dockercompose/ComposeSettings.groovy @@ -70,8 +70,13 @@ abstract class ComposeSettings { protected Boolean customProjectNameSet protected String safeProjectNamePrefix void setProjectName(String customProjectName) { - this.customProjectName = customProjectName - this.customProjectNameSet = true + if (customProjectName == null || customProjectName.isEmpty()) { + this.customProjectName = null + this.customProjectNameSet = false + } else { + this.customProjectName = customProjectName + this.customProjectNameSet = true + } } private Provider projectNameProvider Provider getProjectName() {