Reputation:
i have to create tar.gz , below is my distribution setting in build.gradle
distributions {
main {
contents {
into ("/")
from libsDir
include ‘.jar’
rename '..jar’, “${project.name}.jar”
from “env”
include ‘*.conf’
}
}
}
Please suggest what changes i need to make to build.gradle in order to generate tar.gz file
Upvotes: 5
Views: 3611
Reputation: 7596
gradle 7.6 with kotlin DSL
tasks.distTar {
compression = Compression.GZIP
archiveExtension.set("tar.gz")
}
Upvotes: 0
Reputation: 4749
Similar to the other solutions, this works for me:
tasks.withType(Tar) {
compression = Compression.GZIP
archiveExtension = 'tar.gz'
}
Tested with Gradle 6.8.
Upvotes: 1
Reputation: 11275
With Gradle 6.x
just add to build.gradle
distTar {
compression = Compression.GZIP
archiveExtension = "tar.gz"
}
Upvotes: 3
Reputation: 22671
You can add:
plugins.withType(DistributionPlugin) {
distTar {
compression = Compression.GZIP
extension = 'tar.gz'
}
}
This will configure the Tar
class.
Upvotes: 5