|
@@ -3,6 +3,7 @@
|
|
|
<project name="ieat2" basedir="." default="war" xmlns:ivy="antlib:org.apache.ivy.ant">
|
|
<project name="ieat2" basedir="." default="war" xmlns:ivy="antlib:org.apache.ivy.ant">
|
|
|
<property name="lib.dir" value="lib/"/>
|
|
<property name="lib.dir" value="lib/"/>
|
|
|
<property name="web.dir" value="web/"/>
|
|
<property name="web.dir" value="web/"/>
|
|
|
|
|
+ <property name="test.dir" value="tests/"/>
|
|
|
<property name="conf.dir" value="conf/dev/"/>
|
|
<property name="conf.dir" value="conf/dev/"/>
|
|
|
|
|
|
|
|
<property name="app.name" value="ieat"/>
|
|
<property name="app.name" value="ieat"/>
|
|
@@ -20,16 +21,20 @@
|
|
|
<format property="build.time" pattern="MM/dd/yyyy hh:mm aa z" />
|
|
<format property="build.time" pattern="MM/dd/yyyy hh:mm aa z" />
|
|
|
</tstamp>
|
|
</tstamp>
|
|
|
|
|
|
|
|
|
|
+ <property name="test.failure.halt" value="no"/>
|
|
|
|
|
+ <property name="test.lib" value="${lib.dir}/test/"/>
|
|
|
|
|
+ <property name="test.target.dir" value="${build.dir}/tests"/>
|
|
|
|
|
+
|
|
|
|
|
+ <property name="source.dir" value="src/"/>
|
|
|
|
|
+ <property name="target.dir" value="${build.dir}/${app.name}/WEB-INF/classes"/>
|
|
|
|
|
+
|
|
|
<property prefix="compile" file="${ant.conf.dir}/compile.properties"/>
|
|
<property prefix="compile" file="${ant.conf.dir}/compile.properties"/>
|
|
|
<property name="compile.lib" value="${lib.dir}/compile"/>
|
|
<property name="compile.lib" value="${lib.dir}/compile"/>
|
|
|
<path id="compile.classpath">
|
|
<path id="compile.classpath">
|
|
|
<pathelement location="${target.dir}"/>
|
|
<pathelement location="${target.dir}"/>
|
|
|
<fileset dir="${compile.lib}" includes="*.jar"/>
|
|
<fileset dir="${compile.lib}" includes="*.jar"/>
|
|
|
</path>
|
|
</path>
|
|
|
-
|
|
|
|
|
- <property name="source.dir" value="src/"/>
|
|
|
|
|
- <property name="target.dir" value="${build.dir}/${app.name}/WEB-INF/classes"/>
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<property name="ivy.jar" value="${ant.lib}/ivy.jar"/>
|
|
<property name="ivy.jar" value="${ant.lib}/ivy.jar"/>
|
|
|
<property name="ivy.dep.file" value="${ant.conf.dir}/ivy.xml" />
|
|
<property name="ivy.dep.file" value="${ant.conf.dir}/ivy.xml" />
|
|
|
<available property="ivy.installed" file="${ivy.jar}"/>
|
|
<available property="ivy.installed" file="${ivy.jar}"/>
|
|
@@ -47,7 +52,7 @@
|
|
|
<mkdir dir="${ant.lib}"/>
|
|
<mkdir dir="${ant.lib}"/>
|
|
|
<get dest="${ivy.jar}"
|
|
<get dest="${ivy.jar}"
|
|
|
src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar"/>
|
|
src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar"/>
|
|
|
- <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"/>
|
|
|
|
|
|
|
+ <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar}"/>
|
|
|
<property name="ivy.installed" value="true"/>
|
|
<property name="ivy.installed" value="true"/>
|
|
|
</target>
|
|
</target>
|
|
|
|
|
|
|
@@ -63,21 +68,41 @@
|
|
|
<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" conf="war"/>
|
|
<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" conf="war"/>
|
|
|
</target>
|
|
</target>
|
|
|
|
|
|
|
|
- <target name="ivy.resolve.deploy" unless="ivy.skip" depends="ivy.install">
|
|
|
|
|
- <ivy:retrieve pattern="${ant.lib}/[artifact].[ext]" conf="deploy"/>
|
|
|
|
|
|
|
+ <target name="ivy.resolve.test" unless="ivy.skip" depends="ivy.install">
|
|
|
|
|
+ <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" conf="test"/>
|
|
|
|
|
+ </target>
|
|
|
|
|
+
|
|
|
|
|
+ <target name="ivy.resolve.ant" unless="ivy.skip" depends="ivy.install">
|
|
|
|
|
+ <ivy:retrieve pattern="${ant.lib}/[artifact].[ext]" conf="ant"/>
|
|
|
</target>
|
|
</target>
|
|
|
|
|
|
|
|
- <target name="deploy.load" depends="ivy.resolve.deploy">
|
|
|
|
|
- <taskdef resource="org/apache/catalina/ant/antlib.xml" uri="antlib:org.apache.catalina.ant"/>
|
|
|
|
|
- <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" />
|
|
|
|
|
- <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" />
|
|
|
|
|
|
|
+ <target name="test.load" depends="ivy.resolve.ant">
|
|
|
|
|
+ <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" />
|
|
|
|
|
+ </target>
|
|
|
|
|
+
|
|
|
|
|
+ <target name="deploy.load" depends="ivy.resolve.ant">
|
|
|
|
|
+ <path id="ant.lib.path">
|
|
|
|
|
+ <fileset dir="${ant.lib}" includes="*.jar"/>
|
|
|
|
|
+ </path>
|
|
|
|
|
+ <taskdef resource="org/apache/catalina/ant/antlib.xml"
|
|
|
|
|
+ uri="antlib:org.apache.catalina.ant">
|
|
|
|
|
+ <classpath refid="ant.lib.path"/>
|
|
|
|
|
+ </taskdef>
|
|
|
|
|
+ <taskdef name="deploy"
|
|
|
|
|
+ classname="org.apache.catalina.ant.DeployTask">
|
|
|
|
|
+ <classpath refid="ant.lib.path"/>
|
|
|
|
|
+ </taskdef>
|
|
|
|
|
+ <taskdef name="undeploy"
|
|
|
|
|
+ classname="org.apache.catalina.ant.UndeployTask">
|
|
|
|
|
+ <classpath refid="ant.lib.path"/>
|
|
|
|
|
+ </taskdef>
|
|
|
</target>
|
|
</target>
|
|
|
|
|
|
|
|
<target name="ivy.resolve"
|
|
<target name="ivy.resolve"
|
|
|
- depends="ivy.resolve.compile,ivy.resolve.war,ivy.resolve.deploy"
|
|
|
|
|
|
|
+ depends="ivy.resolve.compile,ivy.resolve.war,ivy.resolve.ant"
|
|
|
description="Use ivy to resolve compilation dependencies"/>
|
|
description="Use ivy to resolve compilation dependencies"/>
|
|
|
|
|
|
|
|
- <target name="compile" depends="ivy.resolve.compile" description="Compile source files">
|
|
|
|
|
|
|
+ <target name="compile.server" depends="ivy.resolve.compile" description="Compile server source files">
|
|
|
<mkdir dir="${target.dir}"/>
|
|
<mkdir dir="${target.dir}"/>
|
|
|
<javac srcdir="${source.dir}"
|
|
<javac srcdir="${source.dir}"
|
|
|
verbose="${compile.verbose}"
|
|
verbose="${compile.verbose}"
|
|
@@ -93,8 +118,28 @@
|
|
|
<classpath refid="compile.classpath" />
|
|
<classpath refid="compile.classpath" />
|
|
|
</javac>
|
|
</javac>
|
|
|
</target>
|
|
</target>
|
|
|
|
|
+
|
|
|
|
|
+ <target name="compile.tests" depends="ivy.resolve.test,compile.server" description="Compile test files">
|
|
|
|
|
+ <mkdir dir="${test.target.dir}"/>
|
|
|
|
|
+ <javac srcdir="${test.dir}"
|
|
|
|
|
+ verbose="${compile.verbose}"
|
|
|
|
|
+ destdir="${test.target.dir}"
|
|
|
|
|
+ debug="${compile.debug}"
|
|
|
|
|
+ deprecation="${compile.deprecation}"
|
|
|
|
|
+ optimize="false"
|
|
|
|
|
+ nowarn="${compile.nowarn}"
|
|
|
|
|
+ includeantruntime="${compile.include.ant}"
|
|
|
|
|
+ bootclasspath="${build.bootstrap.path}"
|
|
|
|
|
+ target="${build.java.version}"
|
|
|
|
|
+ source="${build.java.version}">
|
|
|
|
|
+ <classpath>
|
|
|
|
|
+ <path refid="compile.classpath"/>
|
|
|
|
|
+ <fileset dir="${test.lib}" includes="*.jar"/>
|
|
|
|
|
+ </classpath>
|
|
|
|
|
+ </javac>
|
|
|
|
|
+ </target>
|
|
|
|
|
|
|
|
- <target name="war" depends="compile,ivy.resolve.war" description="Create application WAR">
|
|
|
|
|
|
|
+ <target name="war" depends="compile.server,ivy.resolve.war" description="Create application WAR">
|
|
|
<mkdir dir="${build.dir}"/>
|
|
<mkdir dir="${build.dir}"/>
|
|
|
<war warfile="${build.warfile}" webxml="${app.conf.dir}/web.xml">
|
|
<war warfile="${build.warfile}" webxml="${app.conf.dir}/web.xml">
|
|
|
<lib dir="${build.lib}"/>
|
|
<lib dir="${build.lib}"/>
|
|
@@ -105,6 +150,26 @@
|
|
|
</classes>
|
|
</classes>
|
|
|
</war>
|
|
</war>
|
|
|
</target>
|
|
</target>
|
|
|
|
|
+
|
|
|
|
|
+ <target name="test.server"
|
|
|
|
|
+ description="Run all unit tests on server"
|
|
|
|
|
+ depends="compile.server,compile.tests,test.load">
|
|
|
|
|
+ <junit printsummary="yes" haltonfailure="${test.failure.halt}">
|
|
|
|
|
+ <classpath>
|
|
|
|
|
+ <fileset dir="${test.lib}" includes="*.jar"/>
|
|
|
|
|
+ <path refid="compile.classpath"/>
|
|
|
|
|
+ <pathelement location="${test.target.dir}"/>
|
|
|
|
|
+ </classpath>
|
|
|
|
|
+ <batchtest fork="yes">
|
|
|
|
|
+ <fileset dir="${test.target.dir}">
|
|
|
|
|
+ <include name="**/*.java"/>
|
|
|
|
|
+ </fileset>
|
|
|
|
|
+ </batchtest>
|
|
|
|
|
+ </junit>
|
|
|
|
|
+ </target>
|
|
|
|
|
+
|
|
|
|
|
+ <target name="test" description="Run all tests" depends="test.server">
|
|
|
|
|
+ </target>
|
|
|
|
|
|
|
|
<target name="clean" description="Delete build files">
|
|
<target name="clean" description="Delete build files">
|
|
|
<delete dir="${build.dir}" />
|
|
<delete dir="${build.dir}" />
|