On 20/01/2011, at 9:12 AM, John Murph wrote:

> Well, we use the GRADLE_HOME variable.  Our project structure is like this:
> 
> root
>   - build
>   - modules
>     - buildSrc
>     - other modules
>   - tools
>     - gradle
> 
> We have a "gradle.bat" (and "gradle" *nix script file) file in root directory 
> that sets GRADLE_HOME to tools\gradle.  That's where getting latest from the 
> VCS server will put the currently used Gradle distribution.  This 
> batch/script file also sets up JAVA_HOME and JAVA_OPTS and then calls the 
> "%GRADLE_HOME%/bin/gradle.bat" file (or appropriate replacement for *nix).  
> This makes it so that developers don't need to dig under tools/gradle when 
> running gradle.
> 
> So, we are at least one example of this theoretical person.

You're not that person. The theoretical person would do something more like 
this:

1. set GRADLE_HOME to some-dir\gradle
2. run some-other-dir\gradle\bin\gradle.bat
3. expect that the distribution from some-dir\gradle would be used

That is, this person expects that they can run the 'gradle' script from one 
distribution and have it use the Gradle implementation from some other 
distribution.

You're doing this:

1. set GRADLE_HOME to some-dir\gradle
2. run some-dir\gradle.bat

That is, you are setting GRADLE_HOME to point to the *same* distribution as the 
one containing the 'gradle' script you run.


>   What we would do if you removed this environment variable is not clear to 
> me,

You wouldn't need to do anything. What you've described above will continue to 
work. You can test this now, by renaming GRADLE_HOME in your script to 
something else.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to