I have a complex multi-project build where one of the subprojects (ProjectA) builds a distribution Zip and another project (Installer) depends on it. A copy task in the Installer project complains that it can’t copy from the Zip because it doest exist. Sure enough :ProjectA:zipDist didn’t run yet.
ProjectA’s build.gradle contains:
configurations { distObfuscated }
task zipDist(type: Zip) { ... }
archives {
distObfuscated zipDist
}
In the Installer build.gradle has:
configurations {
projectADist
projectB
}
dependencies {
projectADist project(path: ':ProjectA', configuration: 'distObfuscated')
projectB project(path: ':ProjectB',transitive: false)
}
task prepareImage(type: Copy) {
into "$buildDir/image"
from (configurations.projectADist.findAll{ it.name.endsWith('.zip') }.collect{zipTree(it)})
from (configurations.projectB)
}
I thought that by depending on the distObfuscated configuration, that the zipDist task would automatically run. Doesn’t Gradle know, because of how the archives for ProjectA are declared, that the files in the distObfuscated configuration are ‘builtBy’ the zipDist task?
Is that not how it is supposed to work?