On Wed, Jul 15, 2009 at 14:53, Adam Murdoch<[email protected]> wrote: > > > Jason Porter wrote: >> >> It looks like the gradle.properties in USERHOME/.gradle is it, but how >> does this work if you have multiple projects being built with Gradle? >> Is there a special prefix for the keys to assign it to a particular >> project? > > You can put a gradle.properties file in the project directory of a project. > These properties are applied to the project, and inherited by all its > sub-projects. > > Also, you can use code to do this if the build-in stuff doesn't work. For > example: > > Properties props = new Properties() > file('my-properties.properties').withInputStream { props.load(it) } > props.each { String name, value -> project.setProperty(name, value) } >
That's a lot of code for something so simple. I was mostly looking at this for building in different environments, local, dev, acceptance, prod, etc. If you loaded up properties via the AntBuilder, would they be available to Gradle? That would be simpler solution until (if?) Gradle has a simpler means (maybe wrap it all up into a project method called addProperties or something like that, it could have a few overloads: String, Properties, File, Map, etc) >> I did see >> >> http://gradle.org/latest/docs/userguide/tutorial_this_and_that.html#sec:gradle_properties_and_system_properties >> but I'm a little confused by the syntax of >> ORG_GRADLE_PROJECT_yourProperty=somevalue (which I guess is only good >> for environment variables?). Is it <ORG_GRADLE_PROJECT>_property or >> ORG_GRADLE_<PROJECT>_property, where you replace what's in the angled >> brackets? >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Jason Porter Real Programmers think better when playing Adventure or Rogue. PGP key id: 926CCFF5 PGP fingerprint: 64C2 C078 13A9 5B23 7738 F7E5 1046 C39B 926C CFF5 PGP key available at: keyserver.net, pgp.mit.edu --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
