Thanks for the alternative Phillipe.

Rather than add this snippet to the documentation, I think this should be
made a feature of the dsl. I imagine it would be super easy to do because
there is already the functionality to load gradle.properties. You just need
to make it more generic, allowing any arbitrary properties file to be passed
in.

I've raised a jira for the feature request.

http://jira.codehaus.org/browse/GRADLE-1419



On 4 March 2011 10:28, Philippe Lhoste <[email protected]> wrote:

> On 04/03/2011 01:58, Peter Niederwieser wrote:
>
>> Gradle has a rich API and is based on a general-purpose programming
>> language, so there is almost always a way. Put something like this into
>> the
>> root project's build script:
>>
>> file("master/profiles/$profileId").withReader { reader ->
>>   def userProps = new Properties()
>>   userProps.load(reader)
>>   properties.putAll(userProps)
>> }
>>
>
> Interesting.
> I also found (since I had the same problem some time ago) something like:
>
> Properties props = new Properties()
> props.load(new FileInputStream("$somePath/user.properties"))
> project.setProperty('props', props)
>
> I failed to find these tricks in the Gradle doc.
> If they aren't in it, might I suggest to add them (or one of them)?
> Don't forget that a number of Gradle users (at least, me...) just use
> Gradle as a tool (to compile Java, Scala, whatever) without prior knowledge
> of Groovy and time (or will) to learn it (I might give it a go, but it takes
> time, this scarce resource).
> And it isn't the first time I see such request in this mailing list (which
> I started to read recently...).
>
> Thanks.
>
> --
> Philippe Lhoste
> --  (near) Paris -- France
> --  http://Phi.Lho.free.fr
> --  --  --  --  --  --  --  --  --  --  --  --  --  --
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to