On Dec 11, 2008, at 2:12 PM, Paweł Krupiński wrote:

Is there an easy way of loading custom-named properties file (not
gradle.properties) into Gradle?
I'm integrating with existing ant build and want to reuse its
properties files (named "something.properties" or whatever).

          Paweł

There is no special support for this use case. But what you can easily do is:

configure(new Properties()) {
        load(new FileInputStream(new File('somepath'))
}.each { key, value ->
        project."$key" = value
}

If your ant properties have dots in there name you have to watch when accessing them.

You can't do:
println(my.ant.prop)

You either can do:

println(project."my.ant.prop")

or

println(property("my.ant.prop"))

Please file a Jira if you want Gradle to provide out-of-the-box support for this.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to