/
build.xml
46 lines (40 loc) · 1.79 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE project>
<project name="WMachine" default="create-war" basedir=".">
<description>
WMachine build file.
</description>
<property name="src" location="src" />
<property name="web" location="web" />
<property name="doc" location="doc" />
<property name="build" location="build" />
<property name="tomcat-home" location="/usr/share/tomcat8" />
<path id="classpath">
<fileset dir="${tomcat-home}/lib" includes="*.jar" />
<fileset dir="${web}/WEB-INF/lib" includes="*.jar" />
</path>
<target name="init" description="Clean up before build and create directories.">
<delete dir="${build}" failonerror="false" />
<delete dir="${web}/doc" failonerror="false" />
<mkdir dir="${build}" />
</target>
<target name="compile" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="classpath" includeantruntime="false" />
</target>
<target name="doc" description="Generate Java documentation.">
<javadoc destdir="${doc}" author="true" version="true" use="true" windowtitle="W Machine" classpathref="classpath">
<fileset dir="${src}" />
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
<link href="http://docs.oracle.com/javaee/7/api/"/>
</javadoc>
</target>
<target name="create-war" depends="init,compile,doc" description="Create a WAR file.">
<copy todir="${web}/doc">
<fileset dir="${doc}" />
</copy>
<copy file="${src}/hibernate.cfg.xml" todir="${web}/WEB-INF/classes" />
<war destfile="./build/WMachine.war" webxml="${web}/WEB-INF/web.xml">
<fileset dir="${web}" />
<classes dir="${build}"/>
</war>
</target>
</project>