I'm not sure what the recommended way is, but the only easy way I could find to 
get the value without a deprecation warning is shown in the cookbook wiki for 
using gradle as an embedded repository.

http://wiki.gradle.org/display/GRADLE/Cookbook#Cookbook-Usinggradleitselfasanembeddedrepository

As you can see it's using an internal class, so it almost definitely isn't the 
"recommended" way - but it does avoid the deprecation warning.

GRADLE_HOME I believe is also supposed to go away in the future, so I'm not 
sure that's a much better solution.

-Spencer

--- On Wed, 4/20/11, Benjamin Muschko <[email protected]> wrote:

From: Benjamin Muschko <[email protected]>
Subject: [gradle-user] Retrieving Gradle Home directory
To: [email protected]
Date: Wednesday, April 20, 2011, 10:29 PM

Hi,

I was wondering what the recommended way is to get the Gradle home directory
of the current build being executed. I had a look at the JavaDoc of
Gradle.java and its method 
http://www.gradle.org/latest/docs/javadoc/org/gradle/api/invocation/Gradle.html#getGradleHomeDir%28%29
getGradleHomeDir()  is deprecated but no alternative method was given. In
case I need the Gradle home directory should I use the environment variable
GRADLE_HOME instead?

Thanks,

Ben

--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Retrieving-Gradle-Home-directory-tp4329831p4329831.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