Change name of zip when creating archive with distribution plugin in gradle -


is there way configure distribution file name when creating archive using distribution plugin in gradle?

here build.gradle (i'm using gradle 2.10) file:

apply plugin: 'distribution' version '1.2'  distributions {   custom {     basename = 'somename'     contents {...}   } } 

and calling task customdistzip creates file: $builddir/distributions/somename-1.2.zip have file name configurd to: somename.zip (without version number).

my workaround create new task rename zip file after creation , use gradle finalizedby feature:

task renamedist {   dolast {     new file("$builddir/distributions/somename-${project.version}.zip")             .renameto("$builddir/distributions/somename.zip")   } } customdistzip.finalizedby renamedist 

but don't elegant , nice solution.

you can either do:

customdistzip.setversion('') 

to set version string used basename empty or

customdistzip.setarchivename('somename.zip') 

to set full archive filename, skips basename alltogether.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -