-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
74 lines (64 loc) · 2.74 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
65
66
67
68
69
70
71
72
73
74
<project name="My Project" default="help" basedir=".">
<!-- Ant Demo Project -->
<!-- Define the properties used by the Ant build -->
<property name="app.name" value="GoldenTech"/>
<property name="app.version" value="1.1"/>
<property name="tcserver.home" value="E:\Devops\Tomcat\apache-tomcat-8.5.23\" />
<!--<property name="tcserver.home" value="/home/teja/Desktop/Tomcat-8.5.24" />-->
<property name="work.home" value="${basedir}/work"/>
<property name="dist.home" value="${basedir}/dist"/>
<property name="src.home" value="${basedir}/src"/>
<property name="web.home" value="${basedir}/web"/>
<target name="help">
<echo>You can use the following targets:</echo>
<echo> </echo>
<echo> help : (default) Prints this message </echo>
<echo> all : Cleans, compiles, and packages application</echo>
<echo> clean : Deletes work directories</echo>
<echo> compile : Compiles servlets into class files</echo>
<echo> dist : Packages artifacts into a deployable WAR</echo>
<echo> ${basedir}</echo>
<echo></echo>
<echo>For example, to clean, compile, and package all at once, run:</echo>
<echo>prompt> ant all </echo>
</target>
<!-- Define the CLASSPATH for project-->
<path id="compile.classpath">
<fileset dir="${tcserver.home}/bin">
<include name="*.jar"/>
</fileset>
<pathelement location="${tcserver.home}/lib"/>
<fileset dir="${tcserver.home}/lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="all" depends="clean,compile,dist"
description="Clean work dirs, then compile and create a WAR"/>
<target name="clean" description="Delete old work and dist directories">
<delete dir="${work.home}"/>
<delete dir="${dist.home}"/>
</target>
<target name="prepare" depends="clean"
description="Create working dirs and copy static files to work dir">
<mkdir dir="${dist.home}"/>
<mkdir dir="${work.home}/WEB-INF/classes"/>
<!-- Copy static HTML and JSP files to work dir -->
<copy todir="${work.home}">
<fileset dir="${web.home}"/>
</copy>
</target>
<target name="compile" depends="prepare"
description="Compile Java sources and copy to WEB-INF/classes dir">
<javac srcdir="${src.home}" destdir="${work.home}/WEB-INF/classes" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${work.home}/WEB-INF/classes">
<fileset dir="${src.home}" excludes="**/*.java"/>
</copy>
</target>
<target name="dist" depends="compile"
description="Create WAR file for binary distribution">
<jar jarfile="${dist.home}/${app.name}-${app.version}.war"
basedir="${work.home}"/>
</target>
</project>