logo       

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

lang.groovy.user

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

Properties expansion would be great indeed!
But my little class was just a quick hack.
And it didn't provide that feature.
Since the syntax is the same as Groovy's GString, perhaps I could quite easily
wire that.
I'll have a look at it again to see if I can do it.

--
Guillaume Laforge
http://glaforge.free.fr/weblog


-----Message d'origine-----
De : John Lewis [mailto:063hhyk02-O/bDAPVd7B0N+BqQ9rBEUg@xxxxxxxxxxxxxxxx]
Envoyé : vendredi 29 octobre 2004 15:59
À : user-i9PBDF1N6cxnkHa44VUL00B+6BGkLq7r@xxxxxxxxxxxxxxxx
Objet : Re: [groovy-user] Re: Java World: Build scripts with Groovy and
Ant artcicle



That would be an improvement, and it appears useful. It reminds me of
Ant's <property environment=...

I'm wondering what would happen with this build.properties file:

aproperty=avalue
anotherproperty=${aproperty}/build

Would the results be:

props.aproperty=avalue
props.anotherproperty=avalue/build

?

John

Laforge Guillaume glaforge-at-axway.com |groovy| wrote:

>Hello Patrick,
>
>Interesting, I had an idea along the lines that I didn't commit on CVS.
>It's a GProperties class which would allow us to do things like:
>
>props = new GProperties("build.properties")
>println props.maven.skip.test
>props.my.other.prop = 3
>
>But I can't really create new branches, just read, and modify actual values.
>I'll have another go at it if you think it's useful.
>
>
>--
>Guillaume Laforge
>http://glaforge.free.fr/weblog
>
>
>-----Message d'origine-----
>De : news [mailto:news-WnDAp88bSu3NLxjTenLetw@xxxxxxxxxxxxxxxx]De la part de
>Patrick Mueller
>Envoyé : vendredi 29 octobre 2004 14:49
>À : groovy-user-81qHHgoATdGxIXFVlbCvtR2eb7JE58TQ@xxxxxxxxxxxxxxxx
>Objet : [groovy-user] Re: Java World: Build scripts with Groovy and Ant
>artcicle
>
>
>I just started converting some build.xml files to build.groovy. I
>immediately found that I'd like some of my build properties available as
>Groovy variables, so I now do something like this:
>
> props = new Properties(System.properties)
> props.load(new FileInputStream('build.properties'))
>
>I should really close the FileInputStream, but this is a build script so
>I don't care that much.
>
>I haven't looked, but it would nice if there was a one-shot addition to
>Properties in the GroovyJDK bits so you could do something like this:
>
> props = Properties.loadFile('build.properties')
>
>and maybe some others like:
>
> props = Properties.loadResource(myClass,myResourceName)
> props = Properties.loadStream(inputStream)
>
>
>



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

News | FAQ | advertise