That worked for me...except I had to explicitly state the project object. In
other words, I had to say
if (project.hasProperty("test"))
rather than simply
if (hasProperty("test"))
Thanks.
-----Original Message-----
From: Peter Niederwieser [mailto:[email protected]]
Sent: Monday, February 07, 2011 3:48 PM
To: [email protected]
Subject: [gradle-user] RE: Simulating Maven Profiles
To get something similar to Maven's profiles, add the following to your build
script (or to a separate script pulled in with "apply from: ..."):
if (hasProperty("dev")) {
// adapt configuration to dev environment
} else if (hasProperty("test")) {
// adapt configuration to test environment
}
You can then select an environment like so:
gradle build -Ptest
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Founder, Spock Framework
http://spockframework.org
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Simulating-Maven-Profiles-tp3374782p3374905.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