Skip to main content

Source code file content

Revision: 105

notes for where the source code went
» Project Revision History

» Checkout URL

svn / tags / oscore_2_2_3 / build.xml

Size: 7187 bytes, 1 line
<project default="jar" basedir=".">
  <path id="cp">
    <fileset dir="lib">
      <include name="**/*.jar"/>
    </fileset>
  </path>

  <path id="jalopy.classpath">
    <fileset dir="lib/build/jalopy">
      <include name="*.jar"/>
    </fileset>
  </path>

  <target name="init">
    <property file="build.properties"/>
    <tstamp>
      <format property="release" pattern="-dMMMyy" locale="en" timezone="GMT"/>
    </tstamp>
    <property name="docs" value="docs"/>
    <property name="dist" value="dist"/>
    <property name="build" value="build"/>

    <available property="junit.available" classname="junit.framework.TestCase"/>
    <available property="clover.available" classname="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
  </target>

  <target name="junit-check" depends="init" unless="junit.available">
    <fail message="Cannot run test cases. Please copy lib/build/junit-3.8.1.jar to ${ant.home}/lib"/>
  </target>

  <target name="clover-check" depends="init" unless="clover.available">
    <fail message="Cannot run coverage tests. Please copy lib/build/clover-1.2.3.jar to ${ant.home}/lib"/>
  </target>

  <target name="clean" depends="cleanejb">
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>

  <target name="java" depends="ejbdoclet, format">
    <mkdir dir="${build}/java"/>
    <javac srcdir="src/java" destdir="${build}/java" classpathref="cp" debug="on"/>
    <copy filtering="no" todir="${build}/java">
      <fileset dir="src/java">
        <exclude name="**/*.java"/>
        <exclude name="**/package.html"/>
      </fileset>
    </copy>
  </target>

  <target name="init-clover" depends="init">
    <taskdef resource="clovertasks"/>
    <typedef resource="clovertypes"/>
    <mkdir dir="${build}/clover"/>
    <clover-setup initstring="${build}/clover/coverage.db"/>
  </target>

  <target name="test" depends="clover-check,init-clover,junit-check,ejbdoclet,format">
    <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>

    <mkdir dir="${build}/test"/>
    <javac srcdir="src/java" destdir="${build}/test" classpathref="cp" debug="on"/>
    <copy filtering="no" todir="${build}/test">
      <fileset dir="src/java">
        <exclude name="**/*.java"/>
        <exclude name="**/package.html"/>
      </fileset>
    </copy>

    <javac srcdir="src/test" destdir="${build}/test" classpathref="cp" debug="on"/>
    <copy filtering="no" todir="${build}/test">
      <fileset dir="src/test">
        <exclude name="**/*.java"/>
        <exclude name="**/package.html"/>
      </fileset>
    </copy>

    <mkdir dir="${build}/junit"/>
    <junit printsummary="yes" haltonfailure="yes" haltonerror="yes" fork="yes">
      <jvmarg value="-Djava.awt.headless=true"/>
      <classpath>
        <pathelement location="build/test"/>
        <path refid="cp"/>
      </classpath>

      <formatter type="xml"/>
      <formatter type="plain" usefile="false"/>

      <batchtest todir="${build}/junit">
        <fileset dir="src/test">
          <include name="**/*Test.java"/>
        </fileset>
      </batchtest>
    </junit>
  </target>

  <target name="format">
    <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
      <classpath refid="jalopy.classpath"/>
    </taskdef>

    <jalopy fileformat="unix" convention="${basedir}/src/etc/jalopy.xml" history="file" historymethod="adler32" loglevel="error" threads="2" classpathref="cp">
      <fileset dir="src/java">
        <include name="**/*.java"/>
      </fileset>
      <fileset dir="src/test">
        <include name="**/*.java"/>
      </fileset>
    </jalopy>
  </target>

  <target name="jar" depends="java">
    <mkdir dir="${dist}"/>
    <jar basedir="${build}/java" jarfile="${dist}/${name}-${version}${release}.jar"/>
  </target>

  <target name="javadocs" depends="init">
    <mkdir dir="${dist}/docs/api"/>
    <javadoc sourcepath="src/java" destdir="${dist}/docs/api" stylesheetfile="${docs}/api.css" packagenames="com.opensymphony.*" classpathref="cp" author="true" version="true" windowTitle="${name} ${version}${release} API" doctitle="${name}" footer="See &lt;a href=&quot;http://www.opensymphony.com&quot;&gt;www.opensymphony.com&lt;/a&gt; for more information." use="true" verbose="false"/>
    <!-- <copy overwrite="yes" file="${docs}/main.css" tofile="${docs}/api/stylesheet.css"/> -->
  </target>

  <target name="clover.report" depends="test">
    <clover-report>
      <current outfile="${dist}/docs/clover">
        <format type="html"/>
      </current>
    </clover-report>
  </target>

  <target name="clover.historical" depends="clover.report">
    <clover-historypoint historyDir="${build}/clover"/>

    <clover-report>
      <historical outfile="${dist}/docs/clover" historyDir="${build}/clover">
        <format type="html"/>
      </historical>
    </clover-report>
  </target>

  <target name="junit.report" depends="test">
    <mkdir dir="${dist}/docs/junit"/>
    <junitreport todir="${dist}/docs/junit">
      <fileset dir="${build}/junit">
        <include name="TEST-*.xml"/>
      </fileset>
      <report format="frames" todir="${dist}/docs/junit"/>
    </junitreport>
  </target>

  <target name="docs" depends="javadocs, clover.report, junit.report">
    <copy todir="${dist}/docs">
      <fileset dir="${docs}"/>
    </copy>
  </target>

  <target name="dist" depends="jar, docs">
    <delete file="${dist}/${name}-${version}${release}.zip"/>
    <zip zipfile="${dist}/${name}-${version}${release}.zip" basedir="${dist}"/>
  </target>

  <!-- ******************************************************************* -->
  <!-- Place project-specific stuff here                                   -->
  <!-- ******************************************************************* -->

  <target name="ejbdoclet" depends="init">
    <taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask" classpathref="cp"/>

    <ejbdoclet ejbspec="2.0" verbose="false" destdir="src/java">
      <fileset dir="src/java">
        <include name="**/*EJB.java"/>
      </fileset>
      <remoteinterface/>
      <localinterface/>
      <homeinterface/>
      <localhomeinterface/>
      <!--<valueobject/>-->
      <!--<entitypk/>-->
      <entitycmp/>
      <!--<session/>-->
      <deploymentdescriptor destdir="${build}/java/META-INF" validatexml="true" description="OpenSymphony SequenceGenerator" displayname="Sequence Module"/>
      <jboss version="3.0" destdir="${build}/java/META-INF"/>
      <weblogic version="7.0" destdir="${build}/java/META-INF" datasource="defaultDS" createtables="true"/>
      <jrun version="4.0" destdir="${build}/java/META-INF"/>
      <orion version="2.0" destdir="${build}/java/META-INF"/>
    </ejbdoclet>
  </target>

  <target name="cleanejb" depends="init">
    <delete>
      <fileset dir="src/java">
        <include name="**/*PK.java"/>
        <include name="**/*CMP.java"/>
        <include name="**/*Home.java"/>
        <include name="com/opensymphony/module/sequence/SequenceGenerator.java"/>
        <include name="com/opensymphony/module/sequence/SequenceLocal.java"/>
      </fileset>
    </delete>
  </target>

</project>



 
 
Close
loading
Please Confirm
Close