On 19/11/2010, at 2:04 AM, richardm wrote:

> 
> Using the examples above I get the error:  unable to resolve class Props
> 
> I can't see this in the API docs for 0.9-rc-3.  What import do I need to use
> the Props class?

There's no Props class. You probably want a java.util.Properties.

> 
>    Properties props = new Props()
>    props.load(new FileInputStream("$rootDir/build.properties"))
> 
>    copy {
>       from 'GUI/src/BuildVersionTemplate'
>       into 'GUI/src/BuildVersion.properties'

The into() method specifies a directory to copy into. So, you'll end up with a 
file called 'GUI/src/BuildVersion.properties/BuildVersionTemplate'. We do want 
to add some way for you to specify the final file name, but we haven't done so 
yet.

You might do something like this as a work around:

into 'GUI/src'
rename 'BuildVersionTemplate', 'BuildVersion.properties'


>       props.each { key, value ->
>          filter(ReplaceTokens, tokens: props) // It depends on you set up
> if this is exactly what you want.
>       }


You can replace the above with something like (ie get rid of the each { } loop)

filter(ReplaceTokens, tokens: props)


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to