commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ozeigerm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/transaction build.properties.sample build.xml
Date Tue, 25 May 2004 15:46:16 GMT
ozeigermann    2004/05/25 08:46:16

  Added:       transaction build.properties.sample build.xml
  Log:
  Added build script
  
  Revision  Changes    Path
  1.1                  jakarta-commons-sandbox/transaction/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  #
  # build properties sample, move to build.properties and adapt to your settings 
  #
  
  # compile options
  
  compile.debug=on
  compile.deprecation=on
  compile.optimize=on
  
  # jars
  j2ee.jar=E:/lib/jboss-j2ee.jar
  servlet.jar=E:/lib/servlet.jar
  
  # deploy dirs
  
  jboss.deploy.dir=E:/Programme/jboss-3.2.3/server/default/deploy
  
  
  
  
  1.1                  jakarta-commons-sandbox/transaction/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!-- 
    =======================================================================
    Commons Transaction build file
    ======================================================================= 
  -->
  <project name="commons-transaction" default="all" basedir=".">
  
    <!-- 
    ===================================================================
    Set build properties
    =================================================================== 
    -->
  
    <property file="${basedir}/build.properties"/>
  
    <property name="debug" value="true" />
    <property name="deprecation" value="true" />
    <property name="optimize" value="true" />
  
    <property name="version" value="0.1pre"/>
    <property name="name" value="commons-transaction" />
    <property name="final.name" value="${name}-${version}"/>
  
    <!-- 
    ===================================================================
    Set the properties related to the source tree
    =================================================================== 
    -->
  
    <property name="src.dir" value="${basedir}/src"/>
    <property name="java.dir" value="${src.dir}/java"/>
    <property name="test.dir" value="${src.dir}/test"/>
    <property name="lib.dir" value="${basedir}/lib"/>
    <property name="docs.dir" value="${basedir}/doc"/>
    <property name="conf.dir" value="${src.dir}/conf"/>
    <property name="example.dir" value="${basedir}/example"/>
  
    <!-- 
    ===================================================================
    Set the properties for the build area
    =================================================================== 
    -->
    <property name="build.dir" value="${basedir}/build"/>
    <property name="build.classes" value="${build.dir}/classes"/>
    <property name="build.lib" value="${build.dir}/lib"/>
    <property name="build.deploy" value="${build.dir}/deploy"/>
    <property name="build.javadocs" value="${build.dir}/javadoc"/>
  
    <property name="dist.dir" value="${basedir}/dist"/>
    <property name="dist.lib" value="${dist.dir}/lib"/>
    <property name="dist.deploy" value="${dist.dir}/deploy"/>
  
    <path id="classpath">
      <pathelement location="${build.classes}" />
      <fileset dir="${lib.dir}"/>
      <pathelement location="${j2ee.jar}"/>
      <pathelement location="${servlet.jar}"/>
    </path>
  
    <!-- 
    ===================================================================
    Detect
    =================================================================== 
    -->
    <target name="detect" depends="detect.display,detect.fail" description="Display configuration
and conditional compilation flags"/>
  
    <target name="detect.display">
          <available property="j2ee.present" classname="javax.resource.cci.Connection"
classpath="${j2ee.jar}"/>
          <available property="servlet.present" classname="javax.servlet.Servlet" classpath="${servlet.jar}"/>
          <condition property="jvm14.present">
              <equals arg1="${ant.java.version}" arg2="1.4"/>
          </condition>
          <echo message="+-------------------------------------------------------"/>
          <echo message="| Build environment for ${name} ${version}"/>
          <echo message="| "/>
          <echo message="| Note: "/>
          <echo message="|   If ${property.name} is displayed for a library "/>
          <echo message="|   instead of 'true', that library is not present."/>
          <echo message="+-------------------------------------------------------"/>
          <echo message=""/>
          <echo message="Environment:"/>
          <echo message="  Java home                     ${java.home}"/>
          <echo message="  Java version                  ${ant.java.version}"/>
          <echo message=""/>
          <echo message="Build options:"/>
          <echo message="  Generate debugging info       ${compile.debug}"/>
          <echo message="  Display deprecation info      ${compile.deprecation}"/>
          <echo message="  Optimize                      ${compile.optimize}"/>
          <echo message=""/>
          <echo message="Directories:"/>
          <echo message="  Build directory               ${build.dir}"/>
          <echo message="  Distribution directory        ${dist.dir}"/>
          <echo message="  JBoss deploy directory        ${jboss.deploy.dir}"/>
          <echo message=""/>
          <echo message="Optional Libraries:"/>
          <echo message="  J2EE API                      ${j2ee.present}"/>
          <echo message="  Servlet API                   ${servlet.present}"/>
          <echo message=""/>
          <property name="required.present" value="true"/>
          <!--condition property="required.present">
              <and>
                  <equals arg1="${j2ee.present}" arg2="true"/>
                  <equals arg1="${servlet.present}" arg2="true"/>
              </and>
          </condition-->
      </target>
      <target name="detect.fail" unless="required.present">
          <fail message="Failed dependancy">
        One or more required libraries could not be found.
        Please check your build.propertes file.
      </fail>
      </target>
    <!-- 
    ===================================================================
    Prepare the build              
    =================================================================== 
    -->
  
    <target name="prepare">
      <tstamp />
      <mkdir dir="${build.dir}"/>
      <mkdir dir="${build.classes}"/>
      <mkdir dir="${build.lib}"/>
      <mkdir dir="${build.deploy}"/>
    </target>
  
    <!-- 
    ===================================================================
    Prepare distributions
    =================================================================== 
    -->
  
    <target name="prepare-dist">
      <tstamp />
      <mkdir dir="${dist.dir}"/>
      <mkdir dir="${dist.lib}"/>
      <mkdir dir="${dist.deploy}"/>
    </target>
  
    <!-- 
    ===================================================================
    Build the code           
    =================================================================== 
    -->
  
    <target name="build" depends="prepare">
      <javac destdir="${build.classes}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}" >
        <exclude name="**/jca/**"/>
        <src path="${java.dir}"/>
        <classpath refid="classpath" />
      </javac>
    </target>
    
    <target name="build-test" depends="build">
      <javac destdir="${build.classes}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}" >
        <src path="${test.dir}"/>
        <classpath refid="classpath" />
      </javac>
    </target>
    
    <target name="build-jca" depends="build" if="j2ee.present">
      <javac destdir="${build.classes}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}" >
        <include name="**/jca/**"/>
        <src path="${java.dir}"/>
        <classpath refid="classpath" />
      </javac>
    </target>
    
    <target name="build-map-example" depends="build-jca" if="servlet.present">
      <javac destdir="${build.classes}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}" >
        <src path="${example.dir}/mapConnector/src/java"/>
        <classpath refid="classpath" />
      </javac>
    </target>
    
    <!-- 
    =================================================================== 
    Create the jar
    =================================================================== 
    -->
    <target name="jar" depends="detect, build, build-jca">
  
      <jar jarfile="${build.lib}/${final.name}.jar" basedir="${build.classes}" >
        <include name="org/apache/**" />
        <exclude name="**/*Test*" />
      </jar>
  
      <copy todir="${dist.lib}">
            <fileset dir="${build.lib}"/>
      </copy>
  
    </target>
  
    <!-- 
    =================================================================== 
    Create rar
    =================================================================== 
    -->
  
    <target name="map-connector" depends="detect, prepare-dist, jar, build-jca">
  
      <zip zipfile="${build.deploy}/${final.name}.rar">
        <zipfileset dir="${dist.lib}"/>
        <zipfileset dir="${lib.dir}"/>
        <zipfileset dir="${conf.dir}/connector/map" prefix="META-INF" includes="ra.xml"/>
      </zip>
  
      <copy todir="${dist.deploy}">
            <fileset dir="${build.deploy}"/>
            <fileset dir="${conf.dir}/connector/map/jboss"/>
      </copy>
  
    </target>
  
    <!-- 
    =================================================================== 
    Create map connector example war
    =================================================================== 
    -->
  
    <target name="map-example-war" depends="detect, prepare-dist, jar, build-map-example">
  
      <zip zipfile="${build.deploy}/mapconnector-example.war">
        <zipfileset dir="${build.classes}/connector" prefix="WEB-INF/classes/connector"
includes="TestServlet.class"/>
        <zipfileset dir="${example.dir}/mapConnector/src/conf" prefix="WEB-INF"/>
      </zip>
  
      <copy todir="${dist.deploy}">
            <fileset dir="${build.deploy}"/>
      </copy>
  
    </target>
  
    <!-- 
    =================================================================== 
    Deploy all deployable packages to JBoss
    =================================================================== 
    -->
  
    <target name="deploy-jboss" depends="detect, map-connector, map-example-war">
  
      <copy todir="${jboss.deploy.dir}">
            <fileset dir="${dist.deploy}"/>
      </copy>
  
    </target>
  
  
    <!--
    ===================================================================
    Cleans up build directories
    ===================================================================
    -->
    <target name="clean">
      <delete dir="${build.dir}" />
    </target> 
  
    <target name="clean-javadocs">
      <delete dir="${build.javadocs}"/>
    </target> 
  
    <target name="scrub" depends="clean, clean-javadocs">
      <delete dir="${dist.lib}"/>
      <delete dir="${dist.deploy}"/>
    </target> 
  
    <!-- 
    ===================================================================
    Creates the API documentation                             
    =================================================================== 
    -->
    
    <target name="javadocs" depends="build, clean-javadocs" description="Creates the API
documentation">
      <mkdir dir="${build.javadocs}"/>
      <mkdir dir="${build.javadocs}"/>
      <javadoc sourcepath="${java.dir}"
        packagenames="org.apache.*"
        destdir="${build.javadocs}"
        author="true"
        windowtitle="Commons Transaction API"
        doctitle="Commons Transaction"
        link="http://java.sun.com/j2se/1.4/docs/api/"
        bottom="Copyright &#169; 2004 The Apache Software Foundation. All Rights Reserved."
        classpathref="classpath"/>
    </target>
    
    <target name="all" depends="jar, javadocs"/>
  
    <!-- 
    ===================================================================
    Do JUnit tests
    =================================================================== 
    -->
    
    <target name="test" depends="build" description="Exectutes JUnit tests">
      <junit printsummary="yes" haltonfailure="yes">
        <classpath refid="classpath" />
        <formatter type="plain" />
        <test name="org.apache.commons.transaction.file.FileResourceManagerTest" haltonfailure="yes"
/>
      </junit>
    </target>
  
  </project>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message