Updated Branches:
  refs/heads/master 35d9f22b2 -> fa76c7950

accomodate for cases where JAVA_HOME points to JDK root directory


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/fa76c795
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/fa76c795
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/fa76c795

Branch: refs/heads/master
Commit: fa76c7950d2d40458acaf8828efe42ed8bdd7cae
Parents: 35d9f22
Author: Ulrich Staerk <u...@apache.org>
Authored: Mon Jan 14 13:23:03 2013 +0100
Committer: Ulrich Staerk <u...@apache.org>
Committed: Mon Jan 14 13:23:03 2013 +0100

----------------------------------------------------------------------
 tapestry-javadoc/build.gradle |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fa76c795/tapestry-javadoc/build.gradle
----------------------------------------------------------------------
diff --git a/tapestry-javadoc/build.gradle b/tapestry-javadoc/build.gradle
index e861f3e..278f209 100644
--- a/tapestry-javadoc/build.gradle
+++ b/tapestry-javadoc/build.gradle
@@ -7,9 +7,12 @@ dependencies {
 
 /** Returns the tools.jar/classes.jar of the Java runtime. */
 File getTools() {
-  def relpath = isMacOSX_1_6() ? "../classes/classes.jar" : "../lib/tools.jar"
+  def jreRelpath = isMacOSX_1_6() ? "../classes/classes.jar" : 
"../lib/tools.jar"
+  def jdkRelpath = isMacOSX_1_6() ? "classes/classes.jar" : "lib/tools.jar"
+  
+  def javaHome = System.properties['java.home']
 
-  return new File(System.properties['java.home'], relpath)
+  return new File(javaHome, jdkRelpath).exists() ? new File(javaHome, 
jdkRelpath) : new File(javaHome, jreRelpath)
 }
 
 boolean isMacOSX_1_6() {

Reply via email to