db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: db-ojb build.xml build.properties
Date Wed, 26 Feb 2003 07:03:10 GMT
thma        2003/02/25 23:03:10

  Modified:    .        build.xml build.properties
  Log:
  detect if non-redistributable jars are missing, and print a download hint
  
  Revision  Changes    Path
  1.72      +44 -9     db-ojb/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/build.xml,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- build.xml	16 Feb 2003 21:40:15 -0000	1.71
  +++ build.xml	26 Feb 2003 07:03:10 -0000	1.72
  @@ -27,10 +27,13 @@
               <include name="**/*.jar"/>
               <include name="**/*.zip"/>
           </fileset>
  +        <pathelement path="${j2ee.jars}"/>
  +        <pathelement path="${jdo.jars}"/>
       </path>
   
   
  -    <path id="runtime-classpath">
  +
  +     <path id="runtime-classpath">
           <!-- set at top position, because OJB properties-files should be found first
-->
           <pathelement path="${build.dir}/test/ojb"/>
           <path refid="compilation-classpath"/>
  @@ -44,6 +47,25 @@
       <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>
   
       <target name="use-jdk12" if="jdk-12" depends="detect-jdk">
  @@ -144,10 +166,23 @@
           <delete dir="${dist}" verbose="false"/>
       </target>
   
  +
  +    <target name="checkj2ee.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="checkjdo.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="checkjdori.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>
  +
  +
  +
       <!-- ================================================================== -->
       <!-- Build all the sources with debug and deprecation                   -->
       <!-- ================================================================== -->
  -    <target name="main" depends="prepare, preprocess"
  +    <target name="main" depends="checkj2ee.classes, prepare, preprocess"
               description="Compile all Java sources with debugging on.">
           <javac srcdir="${build.src}" destdir="${build.dest}" excludes="${excludes}"
                  debug="on" deprecation="${deprecation}">
  @@ -160,7 +195,7 @@
       </target>
   
       <!-- include OJB JDORI implementation -->
  -    <target name="with-jdori" depends="prepare"
  +    <target name="with-jdori" depends="prepare, checkjdo.classes, checkjdori.classes"
               description="Compile OJB JDORI">
   	<copy todir="${build.src}">
               <fileset dir="${src.dir}/jdori"/>
  @@ -363,7 +398,7 @@
                 <exclude name="jakarta-regexp-1.2.jar"/>
                 <exclude name="torque-3.0-b3-dev.jar"/>
                 <exclude name="velocity-1.3-dev.jar"/>
  -            </fileset>            
  +            </fileset>
           </copy>
   
           <!-- 4. don't forget the jdbc driver -->
  @@ -491,9 +526,9 @@
               <fileset dir="${source}"/>
           </copy>
           <mkdir dir="${build.dir}/${archive}/lib"/>
  -        <copy todir="${build.dir}/${archive}/lib">         	
  +        <copy todir="${build.dir}/${archive}/lib">
               <fileset dir="${lib}">
  -              <include name="*.jar"/>              
  +              <include name="*.jar"/>
                 <exclude name="jdo.jar"/>
                 <exclude name="jdori.jar"/>
                 <exclude name="jdori-enhancer.jar"/>
  @@ -574,9 +609,9 @@
           <copy todir="${build.dir}/${archive}/lib">
               <fileset dir="${dist}" includes="*.jar"/>
           </copy>
  -        <copy todir="${build.dir}/${archive}/lib">         	
  +        <copy todir="${build.dir}/${archive}/lib">
               <fileset dir="${lib}">
  -              <include name="*.jar"/>              
  +              <include name="*.jar"/>
                 <exclude name="jdo.jar"/>
                 <exclude name="jdori.jar"/>
                 <exclude name="jdori-enhancer.jar"/>
  @@ -897,7 +932,7 @@
   	<!-- ================================================================== -->
       <!-- jdo enhancer - enhancing Product class   			 				-->
       <!-- ================================================================== -->
  -	<target name="enhance">
  +	<target name="enhance" depends="checkjdori.classes">
   
   		<copy file="${src.test}/org/apache/ojb/tutorial4.jdo" todir="target/classestest/org/apache/ojb/"/>
   		<copy file="${src.test}/org/apache/ojb/jdo.dtd" todir="target/classestest/org/apache/ojb/"/>
  
  
  
  1.33      +10 -1     db-ojb/build.properties
  
  Index: build.properties
  ===================================================================
  RCS file: /home/cvs/db-ojb/build.properties,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- build.properties	15 Feb 2003 17:50:22 -0000	1.32
  +++ build.properties	26 Feb 2003 07:03:10 -0000	1.33
  @@ -20,7 +20,16 @@
   #profile=sybase
   #profile=sapdb
   
  -
  +###
  +#
  +# non-redistributable jars
  +# Certain jar files required for a full OJB build may not be shipped 
  +# as part of the OJB distribution.
  +#
  +j2ee.jars=j2ee.jar
  +jdo.jars=jdo.jar:jdori.jar
  +###
  +#
   # The useP6Spy switch determines if the tracing JDBC driver P6Spy is used.
   # If you enable this switch, you must also edit the file
   # jakarta-ojb/src/test/org/apache/ojb/spy.properties
  
  
  

Mime
View raw message