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.

Reply via email to