logo       

Re: Java World: Build scripts with Groovy and Ant artcicle: msg#00160

lang.groovy.user

Subject: Re: Java World: Build scripts with Groovy and Ant artcicle


We do the same thing.

Given build.propeties with contents:

aproperty=avalue

The following:

ant = new AntBuilder()
antprops = ant.property(file:"build.properties").getProject().getProperties()
ant.echo(message:"aproperty=${antprops["aproperty"]}")

will produce:

[echo] aproperty=avalue

It is not pretty, but it works. I wonder if there is a cleaner way of doing it?

John

Daniel Serodio dserodio-at-mandic.com.br |groovy| wrote:

There's one great Ant feature that's missing from this example: build.properties files.

It's a pretty common "idiom" for Ant scripts to include a build.properties in the project's root (ie, same dir as build.xml) with defaults and another on $HOME, which overrides these defaults.

I have tons of projects and a pretty large ~/build.properties, with locations for libraries, etc. How can I achieve the same functionslity with Groovy builder?

TIA,
Daniel Serodio

Philippe Ombredanne wrote:

The article is dated from tomorrow :-) I guess it is already Monday in Europe!
http://www.javaworld.com/javaworld/jw-10-2004/jw-1004-groovy_p.html
By Filippo Diotalevi : http://www.jroller.com/page/fdiotalevi
Thanks Filipo!







<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise