task buildAnsibleTar(type: Tar) {
archiveFileName = "ansible.tar.gz"
destinationDirectory = file("$buildDir/distributions")
compression = Compression.GZIP
from(tasks.named('buildRpm'))
from("${projectDir}/ansible") {
into('ansible')
}
doLast {
println "------------------------------------------------------------"
println "VERIFYING ARCHIVE CONTENT (Cross-Platform):"
File tarFile = archiveFile.get().asFile
if (tarFile.exists()) {
// tarTree allows Gradle to peek inside the archive using Java
// This works on Windows and Linux equally well
project.tarTree(tarFile).each { File internalFile ->
// We calculate the path relative to the archive root to see the hierarchy
// Note: tarTree flattens during iteration, so we show the name
println " - Found in Tar: ${internalFile.name}"
}
} else {
println "ERROR: Archive not found!"
}
println "------------------------------------------------------------"
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)