Extracted the dependency checking into a shared build file which is also used
by the tests build file. Added a call to build the tests to the standard dist call to discourage test rot. Modified build process to copy library dependencies into dist/lib during build so that dist/ contains all build dependencies and build results at the end of the build. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1925 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -18,166 +18,31 @@
|
||||
<!-- declare our classpath business -->
|
||||
<path id="classpath">
|
||||
<pathelement location="${deploy.dir}/classes"/>
|
||||
<fileset dir="lib" includes="**/*.jar"/>
|
||||
<fileset dir="${deploy.dir}/lib" includes="*.jar"/>
|
||||
</path>
|
||||
|
||||
<!-- checks to see which packages are available -->
|
||||
<target name="check-available">
|
||||
<echo message="The packages required for building are listed below."/>
|
||||
<echo message="A package followed by 'true' indicates that the package"/>
|
||||
<echo message="is present. One followed by '${package.present}' indicates"/>
|
||||
<echo message="that it was not found. Jar files can be placed into the"/>
|
||||
<echo message="lib/ directory or placed in the directory referenced"/>
|
||||
<echo message="by your JAVA_LIBS environment variable."/>
|
||||
|
||||
<echo message=""/>
|
||||
<echo message="------------------------------------------"/>
|
||||
<echo message="Standard extensions - http://java.sun.com/"/>
|
||||
<echo message="------------------------------------------"/>
|
||||
<available property="servlet2.3.present"
|
||||
classname="javax.servlet.Servlet" classpathref="classpath"/>
|
||||
<echo message="Servlet 2.3: ${servlet2.3.present}"/>
|
||||
<available property="mail.present"
|
||||
classname="javax.mail.Transport" classpathref="classpath"/>
|
||||
<echo message="Java Mail: ${mail.present}"/>
|
||||
|
||||
<available property="sax.present"
|
||||
classname="org.xml.sax.SAXException" classpathref="classpath"/>
|
||||
<echo message="SAX: ${sax.present}"/>
|
||||
|
||||
<available property="jaxp.present"
|
||||
classname="javax.xml.parsers.SAXParser" classpathref="classpath"/>
|
||||
<echo message="JAXP: ${jaxp.present}"/>
|
||||
|
||||
<available property="javax.persistence.present"
|
||||
classname="javax.persistence.Entity" classpathref="classpath"/>
|
||||
<echo message="Java Persistence: ${javax.persistence.present}"/>
|
||||
|
||||
<echo message=""/>
|
||||
<echo message="----------------------------------------------"/>
|
||||
<echo message="Jakarta libraries - http://jakarta.apache.org/"/>
|
||||
<echo message="----------------------------------------------"/>
|
||||
<available property="jakarta.commons-colls.present"
|
||||
classname="org.apache.commons.collections.CollectionUtils"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Collections: ${jakarta.commons-colls.present}"/>
|
||||
|
||||
<available property="jakarta.commons-logging.present"
|
||||
classname="org.apache.commons.logging.Log"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Logging: ${jakarta.commons-logging.present}"/>
|
||||
|
||||
<available property="jakarta.commons-digester.present"
|
||||
classname="org.apache.commons.digester.Digester"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Digester: ${jakarta.commons-digester.present}"/>
|
||||
|
||||
<available property="jakarta.commons-io.present"
|
||||
classname="org.apache.commons.io.IOUtils"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Io: ${jakarta.commons-io.present}"/>
|
||||
|
||||
<available property="jakarta.velocity.present"
|
||||
classname="org.apache.velocity.Template" classpathref="classpath"/>
|
||||
<echo message="Velocity: ${jakarta.velocity.present}"/>
|
||||
</target>
|
||||
|
||||
<!-- combines package availability into build controls -->
|
||||
<target name="compute-builds" depends="check-available">
|
||||
<echo message="The packages that will be built are listed below. One"/>
|
||||
<echo message="followed by 'true' indicates that it will be built. One"/>
|
||||
<echo message="followed by '${build.package}' indicates that it will"/>
|
||||
<echo message="not be built. If a package is not being built, one or"/>
|
||||
<echo message="more of its dependencies could not be located."/>
|
||||
|
||||
<echo message=""/>
|
||||
<property name="build.util" value="true"/>
|
||||
<!--<echo message="com.samskivert.util: ${build.util}"/>-->
|
||||
|
||||
<property name="build.io" value="true"/>
|
||||
<!--<echo message="com.samskivert.io: ${build.io}"/>-->
|
||||
|
||||
<condition property="build.jdbc">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="jakarta.commons-io.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.jdbc: ${build.jdbc}"/>
|
||||
|
||||
<condition property="build.depot">
|
||||
<and>
|
||||
<isset property="build.jdbc"/>
|
||||
<isset property="javax.persistence.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.jdbc.depot: ${build.depot}"/>
|
||||
|
||||
<condition property="build.net">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="mail.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.net: ${build.net}"/>
|
||||
|
||||
<condition property="build.servlet">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="build.jdbc"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="servlet2.3.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.servlet: ${build.servlet}"/>
|
||||
|
||||
<condition property="build.swing">
|
||||
<isset property="build.util"/>
|
||||
</condition>
|
||||
<echo message="com.samskivert.swing: ${build.swing}"/>
|
||||
|
||||
<property name="build.test" value="true"/>
|
||||
<echo message="com.samskivert.test: ${build.test}"/>
|
||||
|
||||
<condition property="build.velocity">
|
||||
<and>
|
||||
<isset property="build.servlet"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="jakarta.commons-colls.present"/>
|
||||
<isset property="jakarta.velocity.present"/>
|
||||
<isset property="servlet2.3.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.velocity: ${build.velocity}"/>
|
||||
|
||||
<condition property="build.xml">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="jakarta.commons-logging.present"/>
|
||||
<isset property="jakarta.commons-digester.present"/>
|
||||
<isset property="jaxp.present"/>
|
||||
<isset property="sax.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.xml: ${build.xml}"/>
|
||||
</target>
|
||||
<!-- import some targets to check dependency availability -->
|
||||
<import file="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="${deploy.dir}/classes"/>
|
||||
<mkdir dir="${javadoc.dir}"/>
|
||||
<copy todir="${deploy.dir}/classes">
|
||||
<fileset dir="${src.dir}" includes="**/*.properties"/>
|
||||
</copy>
|
||||
<copy todir="${deploy.dir}/lib">
|
||||
<fileset dir="lib" includes="**/*.jar"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- cleans out the installed application -->
|
||||
<target name="clean">
|
||||
<delete dir="${deploy.dir}"/>
|
||||
<ant dir="tests" target="clean"/>
|
||||
</target>
|
||||
|
||||
<!-- build the java class files -->
|
||||
@@ -238,8 +103,13 @@
|
||||
<!-- a target for rebuilding everything -->
|
||||
<target name="all" depends="clean,prepare,compile,javadoc,dist"/>
|
||||
|
||||
<!-- builds the various tests -->
|
||||
<target name="tests">
|
||||
<ant dir="tests" target="compile"/>
|
||||
</target>
|
||||
|
||||
<!-- builds our distribution files (war and jar) -->
|
||||
<target name="dist" depends="prepare,compile">
|
||||
<target name="dist" depends="prepare,compile,tests">
|
||||
<jar destfile="${deploy.dir}/${app.name}.jar"
|
||||
basedir="${deploy.dir}/classes"/>
|
||||
</target>
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- build configuration -->
|
||||
<project name="samskivert" default="compile" basedir=".">
|
||||
|
||||
<!-- checks to see which packages are available -->
|
||||
<target name="check-available">
|
||||
<echo message="The packages required for building are listed below."/>
|
||||
<echo message="A package followed by 'true' indicates that the package"/>
|
||||
<echo message="is present. One followed by '${package.present}' indicates"/>
|
||||
<echo message="that it was not found. Jar files can be placed into the"/>
|
||||
<echo message="lib/ directory or placed in the directory referenced"/>
|
||||
<echo message="by your JAVA_LIBS environment variable."/>
|
||||
|
||||
<echo message=""/>
|
||||
<echo message="------------------------------------------"/>
|
||||
<echo message="Standard extensions - http://java.sun.com/"/>
|
||||
<echo message="------------------------------------------"/>
|
||||
<available property="servlet2.3.present"
|
||||
classname="javax.servlet.Servlet" classpathref="classpath"/>
|
||||
<echo message="Servlet 2.3: ${servlet2.3.present}"/>
|
||||
<available property="mail.present"
|
||||
classname="javax.mail.Transport" classpathref="classpath"/>
|
||||
<echo message="Java Mail: ${mail.present}"/>
|
||||
|
||||
<available property="sax.present"
|
||||
classname="org.xml.sax.SAXException" classpathref="classpath"/>
|
||||
<echo message="SAX: ${sax.present}"/>
|
||||
|
||||
<available property="jaxp.present"
|
||||
classname="javax.xml.parsers.SAXParser" classpathref="classpath"/>
|
||||
<echo message="JAXP: ${jaxp.present}"/>
|
||||
|
||||
<available property="javax.persistence.present"
|
||||
classname="javax.persistence.Entity" classpathref="classpath"/>
|
||||
<echo message="Java Persistence: ${javax.persistence.present}"/>
|
||||
|
||||
<echo message=""/>
|
||||
<echo message="----------------------------------------------"/>
|
||||
<echo message="Jakarta libraries - http://jakarta.apache.org/"/>
|
||||
<echo message="----------------------------------------------"/>
|
||||
<available property="jakarta.commons-colls.present"
|
||||
classname="org.apache.commons.collections.CollectionUtils"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Collections: ${jakarta.commons-colls.present}"/>
|
||||
|
||||
<available property="jakarta.commons-logging.present"
|
||||
classname="org.apache.commons.logging.Log"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Logging: ${jakarta.commons-logging.present}"/>
|
||||
|
||||
<available property="jakarta.commons-digester.present"
|
||||
classname="org.apache.commons.digester.Digester"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Digester: ${jakarta.commons-digester.present}"/>
|
||||
|
||||
<available property="jakarta.commons-io.present"
|
||||
classname="org.apache.commons.io.IOUtils"
|
||||
classpathref="classpath"/>
|
||||
<echo message="Commons Io: ${jakarta.commons-io.present}"/>
|
||||
|
||||
<available property="jakarta.velocity.present"
|
||||
classname="org.apache.velocity.Template" classpathref="classpath"/>
|
||||
<echo message="Velocity: ${jakarta.velocity.present}"/>
|
||||
</target>
|
||||
|
||||
<!-- combines package availability into build controls -->
|
||||
<target name="compute-builds" depends="check-available">
|
||||
<echo message="The packages that will be built are listed below. One"/>
|
||||
<echo message="followed by 'true' indicates that it will be built. One"/>
|
||||
<echo message="followed by '${build.package}' indicates that it will"/>
|
||||
<echo message="not be built. If a package is not being built, one or"/>
|
||||
<echo message="more of its dependencies could not be located."/>
|
||||
|
||||
<echo message=""/>
|
||||
<property name="build.util" value="true"/>
|
||||
<!--<echo message="com.samskivert.util: ${build.util}"/>-->
|
||||
|
||||
<property name="build.io" value="true"/>
|
||||
<!--<echo message="com.samskivert.io: ${build.io}"/>-->
|
||||
|
||||
<condition property="build.jdbc">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="jakarta.commons-io.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.jdbc: ${build.jdbc}"/>
|
||||
|
||||
<condition property="build.depot">
|
||||
<and>
|
||||
<isset property="build.jdbc"/>
|
||||
<isset property="javax.persistence.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.jdbc.depot: ${build.depot}"/>
|
||||
|
||||
<condition property="build.net">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="mail.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.net: ${build.net}"/>
|
||||
|
||||
<condition property="build.servlet">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="build.jdbc"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="servlet2.3.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.servlet: ${build.servlet}"/>
|
||||
|
||||
<condition property="build.swing">
|
||||
<isset property="build.util"/>
|
||||
</condition>
|
||||
<echo message="com.samskivert.swing: ${build.swing}"/>
|
||||
|
||||
<property name="build.test" value="true"/>
|
||||
<echo message="com.samskivert.test: ${build.test}"/>
|
||||
|
||||
<condition property="build.velocity">
|
||||
<and>
|
||||
<isset property="build.servlet"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="jakarta.commons-colls.present"/>
|
||||
<isset property="jakarta.velocity.present"/>
|
||||
<isset property="servlet2.3.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.velocity: ${build.velocity}"/>
|
||||
|
||||
<condition property="build.xml">
|
||||
<and>
|
||||
<isset property="build.io"/>
|
||||
<isset property="build.util"/>
|
||||
<isset property="jakarta.commons-logging.present"/>
|
||||
<isset property="jakarta.commons-digester.present"/>
|
||||
<isset property="jaxp.present"/>
|
||||
<isset property="sax.present"/>
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="com.samskivert.xml: ${build.xml}"/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
+19
-2
@@ -14,13 +14,17 @@
|
||||
<path id="classpath">
|
||||
<pathelement location="../${deploy.dir}/classes"/>
|
||||
<pathelement location="${deploy.dir}/classes"/>
|
||||
<fileset dir="../lib" includes="**/*.jar"/>
|
||||
<fileset dir="lib" includes="**/*.jar"/>
|
||||
<fileset dir="../${deploy.dir}/lib" includes="*.jar"/>
|
||||
<fileset dir="${deploy.dir}/lib" includes="*.jar"/>
|
||||
</path>
|
||||
|
||||
<!-- import some targets to check dependency availability -->
|
||||
<import file="../depends-incl.xml"/>
|
||||
|
||||
<!-- prepares the application directories -->
|
||||
<target name="prepare">
|
||||
<mkdir dir="${deploy.dir}"/>
|
||||
<mkdir dir="${deploy.dir}/lib"/>
|
||||
<mkdir dir="${deploy.dir}/classes"/>
|
||||
<copy todir="${deploy.dir}/classes">
|
||||
<fileset dir="${src.dir}" includes="**/*.properties"/>
|
||||
@@ -29,6 +33,9 @@
|
||||
<copy todir="${deploy.dir}/classes/rsrc">
|
||||
<fileset dir="rsrc" includes="**/*"/>
|
||||
</copy>
|
||||
<copy todir="${deploy.dir}/lib">
|
||||
<fileset dir="lib" includes="**/*.jar"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- cleans out the installed application -->
|
||||
@@ -41,6 +48,16 @@
|
||||
<javac srcdir="${src.dir}" destdir="${deploy.dir}/classes"
|
||||
debug="on" optimize="off" deprecation="off">
|
||||
<classpath refid="classpath"/>
|
||||
<exclude name="com/samskivert/io/**" unless="build.io"/>
|
||||
<exclude name="com/samskivert/jdbc/**" unless="build.jdbc"/>
|
||||
<exclude name="com/samskivert/jdbc/depot/**" unless="build.depot"/>
|
||||
<exclude name="com/samskivert/net/**" unless="build.net"/>
|
||||
<exclude name="com/samskivert/servlet/**" unless="build.servlet"/>
|
||||
<exclude name="com/samskivert/swing/**" unless="build.swing"/>
|
||||
<exclude name="com/samskivert/test/**" unless="build.test"/>
|
||||
<exclude name="com/samskivert/util/**" unless="build.util"/>
|
||||
<exclude name="com/samskivert/velocity/**" unless="build.velocity"/>
|
||||
<exclude name="com/samskivert/xml/**" unless="build.xml"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user