mkalen      2005/03/16 01:32:01

  Modified:    .        build.xml
  Log:
  Move some environment class/env checks away from main targets. Users are 
getting confused and Gump needs silly assignments if requirements that are not 
needed by main/junit are kept in main environment-check. (Re ANT_HOME: if you 
don't have Ant even the check wouldn't run, keep it in doc target only.)
  
  Revision  Changes    Path
  1.170     +41 -47    db-ojb/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/build.xml,v
  retrieving revision 1.169
  retrieving revision 1.170
  diff -u -r1.169 -r1.170
  --- build.xml 11 Mar 2005 19:38:47 -0000      1.169
  +++ build.xml 16 Mar 2005 09:32:01 -0000      1.170
  @@ -92,20 +92,6 @@
       </target>
   
       <target name="environment-check" depends="detect-jdk">
  -             <fail message="Please set the ANT_HOME environment variable to 
the root of your Ant installation.">
  -                     <condition>
  -                             <not>
  -                                     <isset property="env.ANT_HOME"/>
  -                             </not>
  -                     </condition>
  -             </fail>
  -             <fail message="Please make JUnit available in the classpath, 
e.g. by copying the junit.jar from OJB's lib subdirectory into the lib 
subdirectory of your Ant installation (${env.ANT_HOME}/lib).">
  -                     <condition>
  -                             <not>
  -                         <available classname="junit.framework.TestCase"/>
  -                             </not>
  -                     </condition>
  -             </fail>
                <fail message="Please download the JDO 1.0.1 reference 
implementation from 
http://jcp.org/aboutJava/communityprocess/final/jsr012/index2.html and copy the 
jdo.jar, jdori.jar and jdori-enhancer.jar contained in the reference 
implementation binary archive, into OJB's lib directory.">
                <condition>
                        <not>
  @@ -765,23 +751,27 @@
       <!-- ================================================================== 
-->
       <!-- Build the documentation                                            
-->
       <!-- ================================================================== 
-->
  -    <target name="doc" depends="prepare,javadoc"
  -            description="Builds the complete documentation using Forrest">
  -        <fail message="Please set the FORREST_HOME environment variable to 
the 'src/core' subdirectory of your Forrest installation. If you don't have yet 
installed Forrest, you can get it from http://forrest.apache.org.";>
  +    <target name="doc-prepare" depends="prepare">
  +        <fail message="Please set the ANT_HOME environment variable to the 
root of your Ant installation.">
               <condition>
                   <not>
  -                    <isset property="env.FORREST_HOME"/>
  +                    <isset property="env.ANT_HOME"/>
                   </not>
               </condition>
           </fail>
  -        <fail message="Please make the Apache XML Commons Resolver library 
available in the classpath, e.g. by copying the xml-commons-resolver jar file 
from the 'tools/ant/lib' subdirectory of your Forrest installation 
(${env.FORREST_HOME}/tools/ant/lib) into the lib subdirectory of your Ant 
installation (${env.ANT_HOME}/lib).">
  +        <fail message="Please set the FORREST_HOME environment variable to 
the 'src/core' subdirectory of your Forrest installation. If you don't have yet 
installed Forrest, you can get it from http://forrest.apache.org.";>
               <condition>
                   <not>
  -                    <available classname="org.apache.xml.resolver.Resolver"/>
  +                    <isset property="env.FORREST_HOME"/>
                   </not>
               </condition>
           </fail>
  +        <available classname="org.apache.xml.resolver.Resolver" 
property="commons.resolver.available"/>
  +        <fail unless="commons.resolver.available" message="Please make the 
Apache XML Commons Resolver library available in the classpath, e.g. by copying 
the xml-commons-resolver jar file from the 'tools/ant/lib' subdirectory of your 
Forrest installation (${env.FORREST_HOME}/tools/ant/lib) into the lib 
subdirectory of your Ant installation (${env.ANT_HOME}/lib)."/>
  +    </target>
   
  +    <target name="doc" depends="doc-prepare,javadoc"
  +            description="Builds the complete documentation using Forrest">
           <echo message="*** Preparing generation of documentation ..."/>
   
           <delete dir="${build.doc}" failonerror="false"/>
  @@ -844,7 +834,6 @@
                   </not>
               </and>
           </condition>
  -     <echo>Note that you need to use Ant version 1.6+ and have 
commons-resolver (can be found in ${env.FORREST_HOME}/tools/ant/lib) in your 
Ant's lib folder</echo>
        <ant antfile="${env.FORREST_HOME}/forrest.build.xml"
                 dir="${build.doc}"
                 inheritall="false"
  @@ -1115,11 +1104,16 @@
       <!-- ================================================================== 
-->
       <!-- Perform JUnit Tests                                                
-->
       <!-- ================================================================== 
-->
  -    <target name="junit" depends="main, junit-no-compile"
  +    <target name="junit-environment-check">
  +        <available classname="junit.framework.TestCase" 
property="junit.available"/>
  +             <fail unless="junit.available" message="Please make JUnit 
available in the classpath, e.g. by copying the junit.jar from OJB's lib 
subdirectory into the lib subdirectory of your Ant installation 
(${env.ANT_HOME}/lib)." />
  +    </target>
  +
  +    <target name="junit" depends="junit-environment-check, main, 
junit-no-compile"
        description="Performs all JUnit regression tests."/>
   
       <!-- property 'test.package' has to be set at command line -->
  -    <target name="run-test" depends="prepare-repository, copy-testdb">
  +    <target name="run-test" depends="junit-environment-check, 
prepare-repository, copy-testdb">
           <junit printsummary="yes" showoutput="true" fork="yes" 
dir="${build.test}/ojb">
                <jvmarg value="-DOJB.bootLogLevel=INFO" />
               <classpath refid="runtime-classpath"/>
  @@ -1133,11 +1127,11 @@
       </target>
   
       <target name="junit-no-compile"
  -         depends="prepare, prepare-testdb, 
junit-no-compile-no-prepare,junit-no-compile-no-prepare-selected"
  +         
depends="junit-environment-check,prepare,prepare-testdb,junit-no-compile-no-prepare,junit-no-compile-no-prepare-selected"
       />
   
  -    <target name="junit-no-compile-no-prepare"  unless="ojb.testsToRun">
  -
  +    <target name="junit-no-compile-no-prepare"
  +        depends="junit-environment-check" unless="ojb.testsToRun">
           <junit printsummary="yes" fork="yes" dir="${build.test}/ojb">
                <jvmarg value="-DOJB.bootLogLevel=INFO" />
               <jvmarg value="-DOJB.skip.issues=${OJB.skip.issues}" />
  @@ -1167,8 +1161,8 @@
           </junit>
       </target>
   
  -    <target name="junit-no-compile-no-prepare-selected" if="ojb.testsToRun">
  -
  +    <target name="junit-no-compile-no-prepare-selected"
  +        depends="junit-environment-check" if="ojb.testsToRun">
           <junit printsummary="yes" fork="yes" dir="${build.test}/ojb">
               <jvmarg value="-DOJB.bootLogLevel=INFO" />
               <jvmarg value="-DOJB.skip.issues=${OJB.skip.issues}" />
  @@ -1193,31 +1187,31 @@
       </target>
   
         <target name="junit-sqlcount-no-compile"
  -         depends="prepare, prepare-testdb, 
junit-sqlcount-no-compile-no-prepare, junit-sqlcount-impossible"
  +         depends="junit-environment-check, prepare, prepare-testdb, 
junit-sqlcount-no-compile-no-prepare, junit-sqlcount-impossible"
             description="Run the sql statement count tests"
       />
   
  -  <target name="junit-sqlcount-impossible" depends="checkP6Spy" 
unless="shouldUseP6Spy">
  -             <echo message="junit-sqlcount does not run without p6spy.  
Please set ant property -DuseP6Spy=true."/>
  -  </target>
  +    <target name="junit-sqlcount-impossible" depends="checkP6Spy" 
unless="shouldUseP6Spy">
  +        <echo message="junit-sqlcount does not run without p6spy.  Please 
set ant property -DuseP6Spy=true."/>
  +    </target>
   
  -  <!-- run the sql count tests.-->
  -  <!-- todo: maybe let them run in an extra directory -->
  -  <target name="junit-sqlcount-no-compile-no-prepare" depends="checkP6Spy" 
if="shouldUseP6Spy">
  -    <junit printsummary="yes" fork="yes" dir="${build.test}/ojb">
  -             <jvmarg value="-DOJB.bootLogLevel=INFO" />
  -             <jvmarg value="-DOJB.skip.issues=${OJB.skip.issues}" />
  +    <!-- run the sql count tests.-->
  +    <!-- todo: maybe let them run in an extra directory -->
  +    <target name="junit-sqlcount-no-compile-no-prepare" 
depends="junit-environment-check,checkP6Spy" if="shouldUseP6Spy">
  +        <junit printsummary="yes" fork="yes" dir="${build.test}/ojb">
  +            <jvmarg value="-DOJB.bootLogLevel=INFO"/>
  +            <jvmarg value="-DOJB.skip.issues=${OJB.skip.issues}"/>
               <classpath refid="runtime-classpath"/>
  -            <formatter type="plain" />
  -            <formatter type="xml" />
  +            <formatter type="plain"/>
  +            <formatter type="xml"/>
               <test name="org.apache.ojb.broker.sqlcount.AllTests"
  -                  haltonfailure="no"
  -                  outfile="target/test/tests-sqlcount" >
  +                haltonfailure="no"
  +                outfile="target/test/tests-sqlcount">
               </test>
  -    </junit>
  -  </target>
  +        </junit>
  +    </target>
   
  -     <target name="junit-report" depends="" description="create JUnit HTML 
report, requires Xalan">
  +     <target name="junit-report" depends="junit-environment-check" 
description="create JUnit HTML report, requires Xalan">
                <junitreport todir="target/test">
                        <fileset dir="target/test">
                                <include name="tests-*.xml"/>
  @@ -1234,7 +1228,7 @@
   
       </target>
   
  -    <target name="junit-quick" depends="prepare-repository, copy-testdb, 
junit-no-compile-no-prepare,junit-no-compile-no-prepare-selected" />
  +    <target name="junit-quick" 
depends="junit-environment-check,prepare-repository, copy-testdb, 
junit-no-compile-no-prepare,junit-no-compile-no-prepare-selected" />
   
       <!-- ================================================================== 
-->
       <!-- Performance tests, Compares the APIs                               
-->
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to