Hi,
I have a task which gets a big zip dependency and extracts it to some directory…
configurations {
bigzip
}
dependencies {
bigzip “org.example.assets:bigzip:${bigZipVersion}@zip”
}
task unpackBigZip(type: Copy, dependsOn: configurations.bigzip) {
ext.targetOutputDir = new File("$buildDir/unpack/bigzip")
outputs.dir targetOutputDir
from {
configurations.bigzip.collect { zipTree(it) }
}
into targetOutputDir
}
As this is only needed occasionally I wanted to make it conditional:
unpackBigZip.onlyIf { project.hasProperty(‘useBigZip’) }
The problem I have is that even the task is not executed (thanks to the “onlyIf” statement), the dependency is still downloaded by gradle…
How can I make it completely conditional? Any hints?
Thank you in advance, Marian