-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
64 lines (54 loc) · 1.94 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0"?>
<project name="HelloXChart" default="deploy_local" basedir=".">
<property file="build.properties"/>
<path id="classpath">
<fileset dir="${lib.dir}"/>
</path>
<target name="clean">
<echo>Cleaning the ${build.dir}</echo>
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="init" depends="clean">
<echo>Creating the build directory</echo>
<mkdir dir="${build.dir}/WEB-INF/classes"/>
<mkdir dir="${build.dir}/WEB-INF/lib"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="compile" depends="init">
<echo>Compile the source files</echo>
<javac srcdir="${src.dir}" destdir="${build.dir}/WEB-INF/classes">
<classpath refid="classpath"/>
</javac>
</target>
<target name="copy" depends="compile">
<copy todir="${build.dir}/WEB-INF">
<fileset dir="${web.dir}/WEB-INF"/>
</copy>
<copy todir="${build.dir}">
<fileset dir="${web.dir}"/>
</copy>
<copy todir="${build.dir}/WEB-INF/lib">
<fileset dir="${lib.dir}">
<exclude name="servlet-api.jar"/>
</fileset>
</copy>
</target>
<target name="replace" depends="copy">
<replace file="${build.dir}/hello.jsp" token="@TITLE@" value="${ant.project.name}"/>
</target>
<target name="war" depends="replace">
<echo>Building the war file</echo>
<war destfile="${dist.dir}/${ant.project.name}.war" webxml="${build.dir}/WEB-INF/web.xml">
<fileset dir="${build.dir}"/>
</war>
</target>
<target name="deploy_local" depends="war">
<echo>Deploying .war to local Tomcat</echo>
<copy todir="${tomcat.dir}/webapps">
<fileset dir="${dist.dir}">
<include name="${ant.project.name}.war"/>
</fileset>
</copy>
</target>
</project>