You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ho...@apache.org on 2007/01/06 00:14:27 UTC

svn commit: r493229 - /incubator/solr/trunk/build.xml

Author: hossman
Date: Fri Jan  5 15:14:26 2007
New Revision: 493229

URL: http://svn.apache.org/viewvc?view=rev&rev=493229
Log:
refactoring some redundency with the junit check, also stealing the more useful failure message from lucene-java's common-build.xml

Modified:
    incubator/solr/trunk/build.xml

Modified: incubator/solr/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/build.xml?view=diff&rev=493229&r1=493228&r2=493229
==============================================================================
--- incubator/solr/trunk/build.xml (original)
+++ incubator/solr/trunk/build.xml Fri Jan  5 15:14:26 2007
@@ -96,6 +96,8 @@
   <property name="junit.output.dir" location="${dest}/test-results"/>
   <property name="junit.reports" location="${dest}/test-results/reports"/>
   <property name="junit.includes" value="**/Test*.java,**/*Test.java"/>
+  <available property="junitPresent"
+             classname="junit.framework.TestCase" />
 
   <!-- Macro for building checksum files
        This is only needed until the "format" option is supported
@@ -162,8 +164,6 @@
   <target name="compile"
           description="Compile the source code."
           depends="checkJunitPresence">
-    <fail unless="junitPresent"
-          message="Couldn't find JUnit on runtime classpath." />
 
     <mkdir dir="${dest}" />
 
@@ -239,18 +239,21 @@
   </path>
 
   <!-- Check that JUnit is present. -->
-  <target name="checkJunitPresence"
-          description="Check that JUnit is present.">
-    <available property="junitPresent"
-               classname="junit.framework.TestCase" />
+  <target name="checkJunitPresence">
+    <!-- no description so it doesn't show up in -projecthelp -->  
+    <fail unless="junitPresent"> 
+      ##################################################################
+      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>
 
   <!-- Compile unit tests. -->
   <target name="compileTests"
           description="Compile unit tests."
           depends="compile,checkJunitPresence">
-    <fail unless="junitPresent"
-          message="Couldn't find JUnit on the runtime classpath." />
 
     <mkdir dir="${dest}/tests" />
     <javac