// 1. Keep your task definition as is
tasks.register('buildAnsibleTar', Tar) {
archiveFileName = "ansible.tar.gz"
destinationDirectory = file("$buildDir/distributions")
compression = Compression.GZIP
from(tasks.named('buildRpm'))
from("${projectDir}/ansible") { into('ansible') }
}
// 2. The Direct Dependency Chain (No Lifecycle Hooks)
// This links the files directly without touching 'build' or 'assemble'
tasks.named('buildRpm') {
dependsOn tasks.named('jar')
}
tasks.named('buildAnsibleTar') {
dependsOn tasks.named('buildRpm')
}
// 3. Only hook into Publish
// This ensures that when you upload to Artifactory, the TAR is ready.
tasks.named('publish') {
dependsOn tasks.named('buildAnsibleTar')
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)