I have the following task which creates a tar.gz file, I am unable to figure out how to rename a file when I’m creating a tar ball, I tried multiple options including renameTo but I must be doing something wrong.
Any thoughts on how i could rename the jar file when its being copied into tar.gz ?
task distTargz( type: Tar ) {
compression = Compression.GZIP
baseName = project.name
baseFolder = “projectC”
extension = ‘tar.gz’
into("${baseFolder}/lib") {
from { configurations.runtime }
}
into( baseFolder ) {
from { “${buildDir}/VERSION” }
from { “${rootDir}/hiverc” }
}
into("${baseFolder}/build") {
from("${buildDir}/distributions") {
include “*.jar”
}
// Want to rename the Jar file here, When its copied into ${baseFolder}/build
} }