Setting the top directory in a Tar task

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Setting the top directory in a Tar task

Doug Sweetser
This post has NOT been accepted by the mailing list yet.
My task for creating a tar file in gradle-1.3 looks like this:

task tarForDevRelease(type: Tar) {
    from(project.file('.')) {
        exclude '**/*.swp'
        exclude '**/*.pyc'
        [bunch of other excludes]
   }
    compression = Compression.GZIP
}

The tarball gets built fine.  The files are like so:

tar tzf build/distributions/QProcessing-0.3.0.tgz|l
CHANGELOG
gradle-app.setting
LICENSE-2.0.txt
README
...

What I would prefer is they are prepended with the name QProcessing-0.3.0 like so:

QProcessing-0.3.0/CHANGELOG
QProcessing-0.3.0/gradle-app.setting
QProcessing-0.3.0/LICENSE-2.0.txt
QProcessing-0.3.0/README

That way it will unpack to its own directory.  Any suggestions on how to modify my task to do this?
Thanks,
Doug