That works thanks!
The package task should support this out of the box, I think. Why can't you
zip anything and everything?
-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
package(:jar)
end
define 'bar' do
package(:zip)
end
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
dependencies
task :archive => archive
end
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-1.0.0.zip
Archive: target/archive-1.0.0.zip
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: foo-bar-1.0.0.zip OK
testing: foo-baz-1.0.0.jar OK
No errors detected in compressed data of target/archive-1.0.0.zip.
Hope this helps.
--
vic
Quaerendo invenietis.
On Thu, Apr 10, 2008 at 11:05 PM, Harish Krishnaswamy <
harishkswamy@gmail.com> 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
>
|