buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Hugo Borja" <>
Subject Re: Can I package artifacts in a zip?
Date Fri, 11 Apr 2008 03:32:25 GMT
On Thu, Apr 10, 2008 at 10:05 PM, Harish Krishnaswamy <> wrote:

> My situation is, I build a bunch of jars and then I have to zip them up
> along with some files. So I tried to include my installed artifacts, but
> it
> considers them as tasks rather than artifacts. How would I do this?
> Thanks.
> -Harish

Sure,  the following foo:archive task, would create an archive containing
some produced packages, artifacts, and some files :)

  define 'foo' do
    # create some packages, and files to include later
    define 'baz' do
    define 'bar' do
    write 'some/files/a.txt', '1'
    write 'some/files/a/b/c.txt', '2'

    # Now the relevant part

    archive = package(:zip, :id => 'archive')
    archive.add project('baz').package(:jar)
    archive.add project('bar').package(:zip)
    archive.add [artifacts('org.springframework:spring:jar:2.5',
'log4j:log4j:jar:1.2.15')], :path => 'artifacts'
    archive.add FileList['some/files/**/*.txt'], :path => 'docs'

    # Create the archive containing this projects packages and some artifact
    task :archive => archive

vic@odam ~/tmp/pkg $ buildr foo:archive
(in /home/vic/tmp/pkg, development)
Completed in 0.899s
vic@odam ~/tmp/pkg $ unzip -t target/
Archive:  target/
    testing: artifacts/               OK
    testing: artifacts/log4j-1.2.15.jar   OK
    testing: artifacts/spring-2.5.jar   OK
    testing: docs/                    OK
    testing: docs/a.txt               OK
    testing: docs/c.txt               OK
    testing:    OK
    testing: foo-baz-1.0.0.jar    OK
No errors detected in compressed data of target/

Hope this helps.

Quaerendo invenietis.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message