1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-06-29 21:13:30 +00:00
plantuml-server/build.xml
Maxime Sinclair c98015f417 Unit testing included in the ant build file.
The dist directory is the default target of the build artefacts.
2011-02-23 17:36:40 +01:00

71 lines
2.5 KiB
XML

<project default="main" basedir=".">
<target name="main" depends="clean,compile,war">
</target>
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
<pathelement location="test/lib/junit-3.8.1.jar" />
</classpath>
</taskdef>
<target name="init">
<!-- overwrite with your own values in a user.property file -->
<property file="user.property" />
<property name="target" value="dist" description="Target directory of the build"/>
<property name="tomcat-home" value="/tomcat" description="Home directory of Tomcat"/>
<property name="debug" value="false" />
<mkdir dir="${target}" />
<path id="project-classpath">
<fileset dir="content/WEB-INF/lib" includes="*.jar" />
<fileset dir="${tomcat-home}/lib" includes="*.jar" />
</path>
<path id="test-classpath">
<fileset dir="test/lib" includes="*.jar" />
<pathelement location="${target}"/>
</path>
</target>
<target name="clean" depends="init">
<delete file="${target}/plantuml.war" />
<delete>
<fileset dir="${target}" includes="**/*.class"/>
</delete>
<delete dir="content/WEB-INF/classes" />
<mkdir dir="content/WEB-INF/classes" />
</target>
<target name="compile" depends="init">
<javac srcdir="src" destdir="content/WEB-INF/classes" debug="${debug}" classpathref="project-classpath" />
</target>
<target name="war">
<war destfile="${target}/plantuml.war" webxml="content/WEB-INF/web.xml">
<classes dir="content/WEB-INF/classes" />
<fileset dir="content" excludes="WEB-INF/**"/>
<lib dir="content/WEB-INF/lib" />
</war>
</target>
<target name="deploy" depends="main">
<copy file="${target}/plantuml.war" todir="${tomcat-home}/webapps" overwrite="true" />
</target>
<target name="test" depends="init">
<echo>
WARN - Test execution requires an running PlantUMLServer.
</echo>
<javac srcdir="test/src" destdir="${target}" debug="${debug}" classpathref="test-classpath" />
<junit showoutput="true" >
<classpath>
<path refid="test-classpath"/>
</classpath>
<formatter type="plain" usefile="false" />
<test name="net.sourceforge.plantuml.servlet.AllTests"/>
</junit>
</target>
</project>