I'm using the distribution plugin. When I run a gradle build, which depends on gradle assemble, both distTar
and distZip
are triggered, and I end up with both a tarball and a zip file of my distribution. I only need a tarball. running both is time and space consuming (the project distribution is very large).
What would be a clean way to exclude distZip
from a high level gradle build? I know I can use gradle build -x distZip
but I want to run plain gradle build
. I know dependencies can be excluded with build.dependsOn.remove(<name>)
but I saw it described as not-recommended.
Thanks.
You can try:
distZip.enabled = false
One of our gradle builds has starting failing due to this issue. As mentioned by TmTom above the full solution was
task deleteZip {
configurations.archives.artifacts.removeAll {it.file =~ 'zip'}
}
tasks.install.dependsOn(deleteZip)
If tars are also being troublesome add:
configurations.archives.artifacts.removeAll {it.file =~ 'tar'}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With