baef3bccb1
standard Maven layout. I'm not a huge fan of that separation, particularly now that it's de rigueur to ship your sources with your class files. In such circumstances, one could imagine just copying the entire contents of src/main/java into target/classes and being done with it. Class files, XML files, propert files, etc. are all packaged up together into one happy jar file of goodness. Then you don't have extra files off in src/main/resources being demure and hard to notice. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2849 6335cc39-0255-0410-8fd6-9bcaacd3b74c
174 lines
7.6 KiB
XML
174 lines
7.6 KiB
XML
<?xml version="1.0"?>
|
|
<project name="samskivert" default="compile" basedir=".">
|
|
<!-- things you may want to change -->
|
|
<property name="app.name" value="samskivert"/>
|
|
<property name="doc.packages" value="com.samskivert.*"/>
|
|
<property name="doc.overview" value="com/samskivert/overview.html"/>
|
|
<property name="copyright.holder" value="Michael Bayne, et al."/>
|
|
|
|
<!-- things you probably don't want to change -->
|
|
<property name="src.dir" value="src/main/java"/>
|
|
<property name="test.dir" value="src/test/java"/>
|
|
<property name="deploy.dir" value="dist"/>
|
|
<property name="classes.dir" value="${deploy.dir}/classes"/>
|
|
<property name="tclasses.dir" value="${deploy.dir}/test-classes"/>
|
|
<property name="javadoc.dir" value="${deploy.dir}/docs"/>
|
|
<property name="libs.dir" value="lib"/>
|
|
<property name="gwtjar.dir" value="${deploy.dir}/gwt-jar"/>
|
|
<property name="deps.root" value="http://samskivert.googlecode.com/files"/>
|
|
<property name="deps.url" value="${deps.root}/samskivert-depends-1.0.zip"/>
|
|
|
|
<!-- declare our classpath business -->
|
|
<path id="classpath">
|
|
<pathelement location="${classes.dir}"/>
|
|
<fileset dir="${deploy.dir}/lib" includes="*.jar"/>
|
|
</path>
|
|
|
|
<!-- import some targets to enumerate and check dependency availability -->
|
|
<import file="etc/libs-incl.xml"/>
|
|
<import file="etc/depends-incl.xml"/>
|
|
|
|
<!-- prepares the application directories -->
|
|
<target name="prepare">
|
|
<tstamp><format property="year" pattern="yyyy" /></tstamp>
|
|
<mkdir dir="${deploy.dir}"/>
|
|
<mkdir dir="${deploy.dir}/lib"/>
|
|
<mkdir dir="${classes.dir}"/>
|
|
<mkdir dir="${tclasses.dir}"/>
|
|
<mkdir dir="${javadoc.dir}"/>
|
|
<copy todir="${classes.dir}"><fileset dir="src/main/resources" includes="**"/></copy>
|
|
<copy todir="${tclasses.dir}"><fileset dir="src/test/resources" includes="**"/></copy>
|
|
<copy todir="${deploy.dir}/lib" flatten="true">
|
|
<fileset refid="${app.name}.libs"/>
|
|
</copy>
|
|
<!-- make sure we have our minimum required dependencies -->
|
|
<fail message="Missing jar dependencies. Download ${deps.url} and unzip it here.">
|
|
<condition><not><available file="${deploy.dir}/lib/junit4.jar"/></not></condition>
|
|
</fail>
|
|
</target>
|
|
|
|
<!-- cleans out the intermediate build files -->
|
|
<target name="clean">
|
|
<delete dir="${classes.dir}"/>
|
|
<delete dir="${tclasses.dir}"/>
|
|
<delete dir="${deploy.dir}/docs"/>
|
|
<delete dir="${gwtjar.dir}"/>
|
|
<delete failonerror="false"><fileset dir="${deploy.dir}" includes="*.jar"/></delete>
|
|
</target>
|
|
|
|
<!-- wipes the entire build directory clean -->
|
|
<target name="distclean">
|
|
<delete dir="${deploy.dir}"/>
|
|
</target>
|
|
|
|
<!-- build the java class files -->
|
|
<target name="imfer" depends="prepare">
|
|
<javac srcdir="${src.dir}" destdir="${classes.dir}" includeAntRuntime="false"
|
|
debug="on" optimize="${build.optimize}" source="1.5" target="1.5" encoding="utf-8">
|
|
<classpath>
|
|
<path refid="classpath"/>
|
|
<fileset dir="lib" includes="imferrer.jar"/>
|
|
</classpath>
|
|
<compilerarg value="-Xlint"/>
|
|
<compilerarg value="-Xlint:-serial"/>
|
|
<!--<compilerarg value="-implicit:class"/>-->
|
|
<compilerarg value="-proc:only"/>
|
|
</javac>
|
|
</target>
|
|
|
|
<!-- build the java class files -->
|
|
<target name="compile" depends="prepare,compute-builds">
|
|
<javac srcdir="${src.dir}" destdir="${classes.dir}" includeAntRuntime="false"
|
|
debug="on" optimize="${build.optimize}" source="1.5" target="1.5" encoding="utf-8">
|
|
<classpath>
|
|
<path refid="classpath"/>
|
|
<!--<fileset dir="lib" includes="immuter.jar"/>-->
|
|
</classpath>
|
|
<exclude name="com/samskivert/net/MailUtil*" unless="build.mail"/>
|
|
<exclude name="com/samskivert/servlet/**" unless="build.servlet"/>
|
|
<exclude name="com/samskivert/util/Log4JLogger*" unless="log4j.present"/>
|
|
<exclude name="com/samskivert/velocity/**" unless="build.velocity"/>
|
|
<exclude name="com/samskivert/xml/**" unless="build.xml"/>
|
|
<compilerarg value="-Xlint"/>
|
|
<compilerarg value="-Xlint:-serial"/>
|
|
</javac>
|
|
<javac srcdir="${test.dir}" destdir="${tclasses.dir}" includeAntRuntime="false"
|
|
debug="on" optimize="${build.optimize}" source="1.5" target="1.5" encoding="utf-8">
|
|
<classpath>
|
|
<path refid="classpath"/>
|
|
<pathelement location="${classes.dir}"/>
|
|
</classpath>
|
|
<exclude name="com/samskivert/net/MailUtil*" unless="build.mail"/>
|
|
<exclude name="com/samskivert/servlet/**" unless="build.servlet"/>
|
|
<exclude name="com/samskivert/util/Log4JLogger*" unless="log4j.present"/>
|
|
<exclude name="com/samskivert/velocity/**" unless="build.velocity"/>
|
|
<exclude name="com/samskivert/xml/**" unless="build.xml"/>
|
|
<compilerarg value="-Xlint"/>
|
|
<compilerarg value="-Xlint:-serial"/>
|
|
</javac>
|
|
</target>
|
|
|
|
<!-- build the javadoc documentation -->
|
|
<target name="javadoc" depends="prepare,compute-builds">
|
|
<javadoc windowtitle="${app.name} API"
|
|
doctitle="${app.name} API"
|
|
overview="${src.dir}/${doc.overview}"
|
|
destdir="${javadoc.dir}"
|
|
additionalparam="-breakiterator"
|
|
link="http://samskivert.com/code/samskivert/samskivert/docs/api/">
|
|
<packageset dir="${src.dir}">
|
|
<exclude name="com/samskivert/servlet/**" unless="build.servlet"/>
|
|
<exclude name="com/samskivert/velocity/**" unless="build.velocity"/>
|
|
<exclude name="com/samskivert/xml/**" unless="build.xml"/>
|
|
</packageset>
|
|
<bottom>Copyright © 2000-${year} ${copyright.holder}. All Rights Reserved.</bottom>
|
|
<classpath refid="classpath"/>
|
|
<link href="http://java.sun.com/j2se/1.4/docs/api/"/>
|
|
</javadoc>
|
|
</target>
|
|
|
|
<!-- a target for rebuilding everything -->
|
|
<target name="all" depends="clean,compile,javadoc,dist"/>
|
|
|
|
<!-- runs our unit tests -->
|
|
<property name="test" value=""/>
|
|
<target name="tests" depends="compile"
|
|
description="Runs unit tests. Use -Dtest=Foo to run only FooTest.">
|
|
<taskdef name="unit" classpathref="classpath"
|
|
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
|
|
<unit printsummary="off" haltonfailure="yes" fork="${junit.fork}">
|
|
<classpath>
|
|
<pathelement location="${classes.dir}"/>
|
|
<pathelement location="${tclasses.dir}"/>
|
|
<fileset dir="${deploy.dir}/lib" includes="*.jar"/>
|
|
<fileset dir="lib/test" includes="*.jar"/>
|
|
</classpath>
|
|
<sysproperty key="test_dir" value="${tclasses.dir}"/>
|
|
<formatter type="brief" usefile="false"/>
|
|
<batchtest>
|
|
<fileset dir="${test.dir}">
|
|
<include name="**/*${test}*Test.java"/>
|
|
<exclude name="com/samskivert/servlet/**" unless="build.servlet"/>
|
|
<exclude name="com/samskivert/velocity/**" unless="build.velocity"/>
|
|
<exclude name="com/samskivert/xml/**" unless="build.xml"/>
|
|
</fileset>
|
|
</batchtest>
|
|
</unit>
|
|
</target>
|
|
|
|
<!-- builds our jar file -->
|
|
<target name="dist" depends="compile">
|
|
<jar destfile="${deploy.dir}/${app.name}.jar" basedir="${classes.dir}"/>
|
|
<!-- we export a small selection of classes for use by GWT -->
|
|
<mkdir dir="${gwtjar.dir}"/>
|
|
<copy todir="${gwtjar.dir}">
|
|
<fileset dir="${src.dir}" includes="com/samskivert/Utils.gwt.xml"/>
|
|
<fileset dir="${src.dir}" includes="com/samskivert/text/MessageUtil.java"/>
|
|
<fileset dir="${src.dir}" includes="com/samskivert/util/ByteEnum.java"/>
|
|
<fileset dir="${src.dir}" includes="com/samskivert/util/ByteEnumUtil.java"/>
|
|
</copy>
|
|
<jar basedir="${gwtjar.dir}" destfile="${deploy.dir}/${app.name}-gwt.jar"/>
|
|
<delete dir="${gwtjar.dir}"/>
|
|
</target>
|
|
</project>
|