refactoring some redundency with the junit check, also stealing the more useful failure message from lucene-java's common-build.xml

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@493229 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2007-01-05 23:14:26 +00:00
parent 21b830ba5c
commit fc9b7af572
1 changed files with 11 additions and 8 deletions

View File

@ -96,6 +96,8 @@
<property name="junit.output.dir" location="${dest}/test-results"/> <property name="junit.output.dir" location="${dest}/test-results"/>
<property name="junit.reports" location="${dest}/test-results/reports"/> <property name="junit.reports" location="${dest}/test-results/reports"/>
<property name="junit.includes" value="**/Test*.java,**/*Test.java"/> <property name="junit.includes" value="**/Test*.java,**/*Test.java"/>
<available property="junitPresent"
classname="junit.framework.TestCase" />
<!-- Macro for building checksum files <!-- Macro for building checksum files
This is only needed until the "format" option is supported This is only needed until the "format" option is supported
@ -162,8 +164,6 @@
<target name="compile" <target name="compile"
description="Compile the source code." description="Compile the source code."
depends="checkJunitPresence"> depends="checkJunitPresence">
<fail unless="junitPresent"
message="Couldn't find JUnit on runtime classpath." />
<mkdir dir="${dest}" /> <mkdir dir="${dest}" />
@ -239,18 +239,21 @@
</path> </path>
<!-- Check that JUnit is present. --> <!-- Check that JUnit is present. -->
<target name="checkJunitPresence" <target name="checkJunitPresence">
description="Check that JUnit is present."> <!-- no description so it doesn't show up in -projecthelp -->
<available property="junitPresent" <fail unless="junitPresent">
classname="junit.framework.TestCase" /> ##################################################################
JUnit not found.
Please make sure junit.jar is in ANT_HOME/lib, or made available
to Ant using other mechanisms like -lib or CLASSPATH.
##################################################################
</fail>
</target> </target>
<!-- Compile unit tests. --> <!-- Compile unit tests. -->
<target name="compileTests" <target name="compileTests"
description="Compile unit tests." description="Compile unit tests."
depends="compile,checkJunitPresence"> depends="compile,checkJunitPresence">
<fail unless="junitPresent"
message="Couldn't find JUnit on the runtime classpath." />
<mkdir dir="${dest}/tests" /> <mkdir dir="${dest}/tests" />
<javac <javac