Fixed Mac OS build by not requiring tools.jar on Mac
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@177 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/build-tools/doctool/build.xml b/build-tools/doctool/build.xml
index ff0e32a..e256c30 100644
--- a/build-tools/doctool/build.xml
+++ b/build-tools/doctool/build.xml
@@ -3,7 +3,7 @@
<property name="project.tail" value="build-tools/doctool" />
<import file="${gwt.root}/common.ant.xml" />
- <property.ensure name="java.tools.path" location="${java.home}/../lib/tools.jar" message="Cannot find ${java.home}/../lib/tools.jar; please use a JDK when building doc rather than a JRE."/>
+ <property.ensure name="java.tools.path" location="${java.home}/../lib/tools.jar" unless="build.host.ismac" message="Cannot find ${java.home}/../lib/tools.jar; please use a JDK when building doc rather than a JRE." />
<target name="compile" description="Compiles this project">
<mkdir dir="${javac.out}" />
diff --git a/common.ant.xml b/common.ant.xml
index d2a3797..154997d 100755
--- a/common.ant.xml
+++ b/common.ant.xml
@@ -39,8 +39,8 @@
<available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
<fail unless="gwt.tools.exists" message="Cannot find '${gwt.tools}' tools directory; perhaps you should define the GWT_TOOLS environment variable" />
- <!-- JUnit support -->
- <condition property="build.host.platform" value="linux">
+ <!-- Platform identification -->
+ <condition property="build.host.islinux">
<and>
<os family="unix" />
<not>
@@ -48,23 +48,33 @@
</not>
</and>
</condition>
+ <condition property="build.host.platform" value="linux">
+ <isset property="build.host.islinux" />
+ </condition>
- <condition property="build.host.platform" value="mac">
+ <condition property="build.host.ismac">
<and>
<os family="unix" />
<contains string="${os.name}" substring="mac" casesensitive="false" />
</and>
</condition>
+ <condition property="build.host.platform" value="mac">
+ <isset property="build.host.ismac" />
+ </condition>
- <condition property="build.host.platform" value="windows">
+ <condition property="build.host.iswindows">
<os family="windows" />
</condition>
+ <condition property="build.host.platform" value="windows">
+ <isset property="build.host.iswindows" />
+ </condition>
<fail unless="build.host.platform" message="Building on ${os.name} is not supported" />
<condition property="junit.platform.args" value="-XstartOnFirstThread" else="">
<equals arg1="${build.host.platform}" arg2="mac" casesensitive="false" />
</condition>
+ <!-- JUnit support -->
<property name="gwt.dev.staging.jar" location="${gwt.build.staging}/gwt-${build.host.platform}-${gwt.version}/gwt-dev-${build.host.platform}.jar" />
<property name="gwt.junit.port" value="8888" />
@@ -168,9 +178,15 @@
<attribute name="name" />
<attribute name="location" />
<attribute name="message" default="Cannot find dependency ${@{name}}" />
+ <attribute name="unless" default="__nonexistent_property__" />
<sequential>
<property name="@{name}" location="@{location}" />
- <available file="${@{name}}" property="@{name}.exists" />
+ <condition property="@{name}.exists">
+ <or>
+ <available file="${@{name}}" />
+ <isset property="@{unless}" />
+ </or>
+ </condition>
<fail unless="@{name}.exists" message="@{message}" />
</sequential>
</macrodef>
diff --git a/doc/build.xml b/doc/build.xml
index 3b64647..4908d98 100644
--- a/doc/build.xml
+++ b/doc/build.xml
@@ -3,6 +3,8 @@
<property name="project.tail" value="doc" />
<import file="${gwt.root}/common.ant.xml" />
+ <property.ensure name="java.tools.path" location="${java.home}/../lib/tools.jar" unless="build.host.ismac" message="Cannot find ${java.home}/../lib/tools.jar; please use a JDK when building doc rather than a JRE." />
+
<property.ensure name="gwt.user.jar" location="${gwt.build.lib}/gwt-user.jar" />
<!-- Platform shouldn't matter here, just picking one -->
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev-linux.jar" />
@@ -29,8 +31,6 @@
<path refid="USER_SOURCE_PATH" />
</path>
- <property.ensure name="java.tools.path" location="${java.home}/../lib/tools.jar" message="Cannot find ${java.home}/../lib/tools.jar; please use a JDK when building doc rather than a JRE."/>
-
<path id="DOC_PATH">
<pathelement location="./src" />
<pathelement location="${gwt.build.lib}/gwt-doctool.jar" />