buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <boisv...@intalio.com>
Subject Re: Creating an artifact containing all jars in a zip
Date Tue, 26 May 2009 17:18:13 GMT
How about something like,

batik_artifacts = [] # initialized by task :init_task

task :init_batik do
  ...
  Dir.glob(batik_dir) do |t|
    (name, version) =
File.basename(t).match(/(.*)-(\d[\d\.]*)\.jar/).to_a[1..2]
    batik_artifacts << artifact("batik:#{name}:jar:#{version}").from(t)
  end
end

alex


2009/5/21 Brendan Grainger <brendan.grainger@gmail.com>

> Hi,
>
> I'm trying to create an artifact that contains all jars found in a zip
> download. So far I have this:
>
> task :install_jars do
>    batik_zip = artifact("batik:batik:zip:1.7")
>    download(batik_zip.name => "
> http://apache.osuosl.org/xmlgraphics/batik/batik-1.7.zip")
>    unzip_batik = unzip('target' => batik_zip)
>    unzip_batik.target.invoke
>    batik_dir = File.join(unzip_batik.target.name, "batik*", "lib",
> "*.jar")
>
>    Dir.glob(batik_dir) do |t|
>      # Now what?
>      # bean = artifact('example.com:beans:jar:1.0').from(bean_jar)
>    end
>
>    batik_dir = File.join(unzip_batik.target.name, "batik*", "*.jar")
>    puts batik_dir.inspect
>    batik_artifact = artifact("batik:batik:jar:1.7")
>    Dir.glob(batik_dir) do |t|
>
>      # Now what?
>    end
>
>    # bean = artifact('example.com:beans:jar:1.0').from(bean_jar)
>  end
>
> Any ideas about the now what? part. Sorry I'm still pretty inexperienced
> with buildr, but can see it's potential.
>
> Cheers
> Brendan

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