Kevin Stembridge wrote:
> 
> So in Gradle, is there a way to load an arbitrary properties file which
> will then become properties of the current project?
> 

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)
}

If you prefer 'profile.id' over 'profileId', '$profileId' would have to be
replaced with '${properties['profile.id']}'. You could also consider to use
a user's login name instead of a manually set up profileId property.

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradleware
http://www.gradleware.com
Creator, Spock Framework
http://spockframework.org




--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Load-properties-from-an-arbitrary-properties-file-tp3408710p3408847.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email


Reply via email to