Skip to content

Commit

Permalink
Use archiveBaseName and archiveVersion to optimize gradle zip task (#728
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ruanwenjun authored Jan 24, 2022
1 parent 8fcddf0 commit 127972e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,20 @@ allprojects {
}

task tar(type: Tar) {
extension = 'tar.gz'
archiveBaseName.set(project.name)
archiveVersion.set(project.version.toString())
archiveExtension.set('tar.gz')
compression = Compression.GZIP
archiveFileName = project.name + '-' + project.version + '.' + extension
destinationDirectory = new File(projectDir, 'build')
into('/') {
from 'dist'
}
}

task zip(type: Zip) {
extension = 'zip'
archiveFileName = project.name + '-' + project.version + '.' + extension
archiveBaseName.set(project.name)
archiveVersion.set(project.version.toString())
archiveExtension.set('zip')
destinationDirectory = new File(projectDir, 'build')
into('/') {
from 'dist'
Expand Down

0 comments on commit 127972e

Please sign in to comment.