removeContainers = false is broken when using gradle 8.x
it seems that the value is not override
I got it working again when doing
getRemoveContainers() {
return false;
}
however, this syntax is not recommended in gradle 8
Hello, what do you please mean by is broken? 🙏
I figured out the correct syntax a while ago and I forgot to update here.
If I have the following in gradle.properties
removeContainers=false
and If I have the following in build.gradle
dockerCompose {
mysql {
removeContainers = project.ext.removeContainers.toBoolean()
}
}
the above will not work, removeContainers is calling the getter and the "=" is not mutating the removeContainers value. the correct syntax when using gradle 8 should be the following:
dockerCompose {
mysql {
removeContainers project.ext.removeContainers.toBoolean()
}
}
removing the "=" will call the setter
That's interesting. Here you can see that the getRemoveContainers is Property<Boolean> so it should IMHO work 🤔
I get what you mean. I have tried that and set break point to debug. but it didn't work.
This is actually broken for more than a year and I used to use
getRemoveContainers() {
return false;
}
to get around the issue. And I just figure out a cleaner way to override the value using removeContainers project.ext.removeContainers.toBoolean()