how to make dist archive

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to make dist archive

Nick Evgeniev
Hi,

How do I make a dist archive? Roughly speaking it's a zip file containing project jar with all it's dependencies & config files organized in particular directory tree.

Reply | Threaded
Open this post in threaded view
|

Re: how to make dist archive

Marko Bauhardt-3

On Sep 15, 2008, at 10:52 AM, Nick Evgeniev wrote:

>
> Hi,

Hi Nick,
you can copy your dependencies into a separat folder like this

---
File runtimeLibsDir = new File(buildDir, 'runtimeLibs')
createTask('collectRuntimeLibs') {
   runtimeLibsDir.mkdirs()
   dependencies.resolve('runtime').each {File file ->
     ant.copy(file: file, todir: runtimeLibsDir)
   }
}
---

after that create zip archive with a fileSet of your conf folders and  
your dependencies

---
dists {
   String zipRoot = "$archivesBaseName-$version"

   zip() {
//binary files
     zipFileSet(dir: file('src/main/scripts'), prefix: "$zipRoot/bin",  
fileMode: '775')

//conf files
     zipFileSet(dir: file('src/main/resources'), prefix: "$zipRoot/
conf")

//dependencies
     zipFileSet(dir: runtimeLibsDir, prefix: "$zipRoot/lib")

//project jar
     zipFileSet(dir: buildDir, prefix: "$zipRoot/lib") {
       include('*.jar')
     }
   }
   archive_zip.dependsOn('collectRuntimeLibs')
}
---


Hope this helps

marko



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email