buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Hugo Borja <vbo...@apache.org>
Subject Re: downloading an external jar as an artifact
Date Fri, 03 Dec 2010 15:37:20 GMT
Hi,

Try  artifact(:hamcrest).version

Cheers

On Fri, Dec 3, 2010 at 7:37 AM, Ilya Pyatigorskiy <atamur@gmail.com> wrote:

> Hi
>
> I'm extremely new to both ruby and buildr, so I'm pretty sure I'm asking a
> stupid thing right now, but I wasn't able to google it.
>
> My target is to be able to specify jar versions in a single place and I
> like
> the build.yaml approach, but some of the libs do not exist in the maven
> world, so I want buildr to download them. Taking the DOJO example from the
> docs I was able to create the following config:
>
> --- build.yaml ---
> # This project requires the following ruby gems, buildr addons
> artifacts:
>  hamcrest: hamcrest:hamcrest:all:1.3.0RC2
> --- /build.yaml ---
>
> --- buildfile ---
> hamcrestVer = Buildr.settings.build['artifacts'][:hamcrest.to_s][/[^:]+$/]
> hamcrestUrl = "
> http://hamcrest.googlecode.com/files/hamcrest-all-#{hamcrestVer}.jar"
> download(artifact(:hamcrest)=>hamcrestUrl)
>
> desc "The project"
> define "proj" do
>  define "webui" do
>    compile.with :hamcrest
>  end
> end
> --- /buildfile ---
>
> that does work, but the way I was finally able to obtain the hamcrest
> version seems quite ugly to me. What would be a better way to achieve the
> same?
>
> Thank you!
>
> Ilya.
>



-- 
vic

Quaerendo invenietis.

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