tomdz       2005/01/25 12:02:35

  Modified:    .        Tag: OJB_1_0_RELEASE build.xml .classpath
  Log:
  Simplified and enhanced environment check for building OJB
  Removed the need for j2ee.jar in most cases (the geronimo jars are now used 
during compilation whenever possible)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.144.2.15 +95 -70    db-ojb/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/build.xml,v
  retrieving revision 1.144.2.14
  retrieving revision 1.144.2.15
  diff -u -r1.144.2.14 -r1.144.2.15
  --- build.xml 23 Jan 2005 03:09:13 -0000      1.144.2.14
  +++ build.xml 25 Jan 2005 20:02:35 -0000      1.144.2.15
  @@ -76,70 +76,118 @@
       <!-- ================================================================== 
-->
       <!-- I N I T                                                            
-->
       <!-- ================================================================== 
-->
  -    <target name="init" depends="set-archive-name,set-archive-name-date,
  -                                                      use-jdk12, use-jdk13, 
use-jdk14">
  -        <available property="junit.present" 
classname="junit.framework.TestCase"/>
  -        <condition property="j2ee.classes">
  -          <and>
  -            <available classname="javax.transaction.Transaction" 
classpathref="compilation-classpath"/>
  -            <available classname="javax.servlet.Servlet" 
classpathref="compilation-classpath"/>
  -            <available classname="javax.ejb.SessionBean" 
classpathref="compilation-classpath"/>
  -          </and>
  -        </condition>
  -        <condition property="jdo.classes">
  -          <and>
  -            <available classname="javax.jdo.PersistenceManager" 
classpathref="compilation-classpath"/>
  -          </and>
  -        </condition>
  -        <condition property="jdori.classes">
  -          <and>
  -            <available classname="com.sun.jdori.enhancer.Main" 
classpathref="compilation-classpath"/>
  -            <available classname="com.sun.jdori.FieldManager" 
classpathref="compilation-classpath"/>
  -          </and>
  -        </condition>
  +    <target name="init"
  +         depends="environment-check,
  +                  set-archive-name,
  +                  set-archive-name-date,
  +                  use-jdk12, use-jdk13, use-jdk14, use-jdk15"/>
  +
  +    <target name="detect-jdk">
  +     <condition property="jdk-12">
  +             <equals arg1="${ant.java.version}" arg2="1.2" />
  +             </condition>
  +     <condition property="jdk-13">
  +             <equals arg1="${ant.java.version}" arg2="1.3" />
  +             </condition>
  +     <condition property="jdk-14">
  +             <equals arg1="${ant.java.version}" arg2="1.4" />
  +             </condition>
  +     <condition property="jdk-15">
  +             <equals arg1="${ant.java.version}" arg2="1.5" />
  +             </condition>
       </target>
   
  -    <target name="use-jdk12" if="jdk-12" depends="detect-jdk, 
check-jdk12proxy-classes, check-jndi-classes">
  +    <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 set the FORREST_HOME environment variable 
to the root of your Forrest installation. If you don't have yet installed 
Forrest, you can get it from http://forrest.apache.org.";>
  +                     <condition>
  +                             <not>
  +                                     <isset property="env.FORREST_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 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).">
  +                     <condition>
  +                             <not>
  +                         <available 
classname="org.apache.xml.resolver.Resolver"/>
  +                             </not>
  +                     </condition>
  +             </fail>
  +             <fail message="Please download the JDO 1.0.1 reference 
implementation from http://jcp.org/aboutJava/communityprocess/final/jsr012 and 
copy the jdo.jar, jdori.jar and jdori-enhancer.jar into OJB's lib directory.">
  +             <condition>
  +                     <not>
  +                     <and>
  +                             <!-- We're checking for a class that is not 
available in JDO 1.0.0 -->
  +                             <available 
classname="javax.jdo.JDOObjectNotFoundException"
  +                                        
classpathref="compilation-classpath"/>
  +                             <available 
classname="com.sun.jdori.enhancer.Main"
  +                                                
classpathref="compilation-classpath"/>
  +                             <available 
classname="com.sun.jdori.FieldManager"
  +                                                
classpathref="compilation-classpath"/>
  +                     </and>
  +                     </not>
  +             </condition>
  +             </fail>
  +             <fail message="In order to compile OJB with JDK 1.2 you need to 
download cglib from http://cglib.sourceforge.net and put the jar into OJB's lib 
folder.">
  +             <condition>
  +                     <and>
  +                         <isset property="jdk-12"/>
  +                             <not>
  +                             <available classname="net.sf.cglib.proxy.Proxy"
  +                                            
classpathref="compilation-classpath"/>
  +                             </not>
  +                     </and>
  +             </condition>
  +         </fail>
  +             <fail message="Please make the JNDI classes (javax.naming.*) 
available in your classpath. Download them from 
http://java.sun.com/products/jndi/downloads/index.html and copy the jndi.jar 
into OJB's lib directory.">
  +             <condition>
  +                     <not>
  +                     <available classname="javax.naming.InitialContext"
  +                                    classpathref="compilation-classpath"/>
  +                     </not>
  +             </condition>
  +         </fail>
  +     </target>
  +
  +    <target name="use-jdk12" if="jdk-12">
        <property name="JDK" value="-JDK13"/>
        <property name="JDBC" value="-JDBC30"/>
        <property name="excludes" value="org/apache/ojb/tools/mapping/**"/>
        <echo message="detected JDK 1.2"/>
       </target>
   
  -    <target name="use-jdk13" if="jdk-13" depends="detect-jdk">
  +    <target name="use-jdk13" if="jdk-13">
        <property name="JDK" value="+JDK13"/>
        <property name="JDBC" value="-JDBC30"/>
        <property name="excludes" value=""/>
        <echo message="detected JDK 1.3"/>
       </target>
   
  -    <target name="use-jdk14" if="jdk-14" depends="detect-jdk">
  +    <target name="use-jdk14" if="jdk-14">
        <property name="JDK" value="+JDK13"/>
        <property name="JDBC" value="+JDBC30"/>
        <property name="excludes" value=""/>
        <echo message="detected JDK 1.4"/>
       </target>
   
  -    <target name="detect-jdk">
  -     <condition property="jdk-12">
  -             <equals arg1="${ant.java.version}" arg2="1.2" />
  -             </condition>
  -     <condition property="jdk-13">
  -             <equals arg1="${ant.java.version}" arg2="1.3" />
  -             </condition>
  -     <condition property="jdk-14">
  -             <equals arg1="${ant.java.version}" arg2="1.4" />
  -             </condition>
  -        <condition property="jndi.classes">
  -          <and>
  -            <available classname="javax.naming.InitialContext" 
classpathref="compilation-classpath"/>
  -          </and>
  -        </condition>
  -        <condition property="jdk12proxy.classes">
  -          <and>
  -            <available classname="com.develop.java.lang.reflect.Proxy" 
classpathref="compilation-classpath"/>
  -          </and>
  -        </condition>
  +    <target name="use-jdk15" if="jdk-15">
  +     <property name="JDK" value="+JDK13"/>
  +     <property name="JDBC" value="+JDBC30"/>
  +     <property name="excludes" value=""/>
  +     <echo message="detected JDK 1.5"/>
       </target>
   
       <target name="set-archive-name-date" if="useDate">
  @@ -225,32 +273,9 @@
   
   
       <!-- ================================================================== 
-->
  -    <!-- auxilliary targets that verify that non-ditributable jars          
-->
  -    <!-- are present on the classpath.                                      
-->
  -    <!-- ================================================================== 
-->
  -    <target name="check-j2ee-classes" unless="j2ee.classes">
  -       <fail>j2ee.jar is missing! Please get it from 
http://java.sun.com/j2ee/. Put it in lib or have the ant property j2ee.jars 
point at this jar file.</fail>
  -    </target>
  -    <target name="check-jdo-classes" unless="jdo.classes">
  -       <fail>jdo.jar is missing! Please get it from 
http://java.sun.com/products/jdo. Put it in lib or have the ant property 
jdo.jars point at this jar file.</fail>
  -    </target>
  -    <target name="check-jdori-classes" unless="jdori.classes">
  -       <fail>jdori.jar is missing! Please get it from 
http://java.sun.com/products/jdo. Put it in lib or have the ant property 
jdo.jars point at this jar file.</fail>
  -    </target>
  -    <target name="check-jndi-classes" if="jdk-12" unless="jndi.classes">
  -       <fail>jndi.jar is missing! Please get it from http://java.sun.com/. 
Put it in the lib directory.</fail>
  -    </target>
  -    <target name="check-jdk12proxy-classes" if="jdk-12" 
unless="jdk12proxy.classes">
  -       <fail>proxy.jar is missing! Please get it from 
http://sf.net/projects/objectbridge/. Put it in the lib directory.</fail>
  -    </target>
  -
  -
  -
  -
  -    <!-- ================================================================== 
-->
       <!-- Build all the sources with debug and deprecation                   
-->
       <!-- ================================================================== 
-->
  -    <target name="main" depends="prepare, check-j2ee-classes, 
check-jdo-classes, preprocess"
  +    <target name="main" depends="prepare, preprocess"
               description="Compile all Java sources with debugging on.">
           <javac srcdir="${build.src}" destdir="${build.dest}" 
excludes="${excludes}"
                  debug="on" debuglevel="source,lines,vars" 
deprecation="${deprecation}">
  @@ -267,7 +292,7 @@
       </target>
   
       <!-- include OJB JDORI implementation -->
  -    <target name="with-jdori" depends="prepare, check-jdo-classes, 
check-jdori-classes"
  +    <target name="with-jdori" depends="prepare"
               description="Compile OJB JDORI">
                <copy todir="${build.src}">
               <fileset dir="${src.dir}/jdori"/>
  
  
  
  1.35.2.3  +1 -1      db-ojb/.classpath
  
  Index: .classpath
  ===================================================================
  RCS file: /home/cvs/db-ojb/.classpath,v
  retrieving revision 1.35.2.2
  retrieving revision 1.35.2.3
  diff -u -r1.35.2.2 -r1.35.2.3
  --- .classpath        12 Jan 2005 21:23:05 -0000      1.35.2.2
  +++ .classpath        25 Jan 2005 20:02:35 -0000      1.35.2.3
  @@ -28,7 +28,6 @@
        <classpathentry kind="lib" path="lib/xml-apis.jar"/>
        <classpathentry kind="lib" path="lib/jcs.jar"/>
        <classpathentry kind="lib" path="lib/jdori.jar"/>
  -     <classpathentry kind="lib" path="lib/j2ee.jar"/>
        <classpathentry kind="lib" path="lib/log4j-1.2.8.jar"/>
        <classpathentry kind="lib" path="lib/torque-3.0.2.jar"/>
        <classpathentry kind="lib" path="lib/velocity-1.3.1.jar"/>
  @@ -40,5 +39,6 @@
        <classpathentry kind="lib" path="lib/ant-junit.jar"/>
        <classpathentry kind="lib" path="lib/ant-launcher.jar"/>
        <classpathentry kind="lib" 
path="samples/tutorial1-struts/lib/struts.jar"/>
  +     <classpathentry kind="lib" path="lib/geronimo-spec-j2ee-1.4-rc2.jar"/>
        <classpathentry kind="output" path="target/classes"/>
   </classpath>
  
  
  

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

Reply via email to