-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
173 lines (153 loc) · 5.9 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright (C) 2006, 2007 Carl E Harris, Jr.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
-->
<project name="soulwing-casclient" default="all" basedir=".">
<property file="build.properties"/>
<condition property="product.jar.includes.tests.flag">
<istrue value="${product.jar.includes.tests}"/>
</condition>
<path id="project.classpath">
<pathelement location="${build.classes}"/>
<pathelement location="${build.test.classes}"/>
<fileset dir="${vendor.lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${vendor.test.lib}">
<include name="*.jar"/>
</fileset>
</path>
<target name="all" depends="prepare, build, test"
description="compiles all source and runs unit tests"/>
<target name="prepare">
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.test.classes}"/>
<copy todir="${build.classes}">
<fileset dir="${src}" includes="**/*.properties"/>
</copy>
</target>
<target name="clean"
description="cleans all compiled classes">
<delete dir="${build.classes}"/>
<delete dir="${build.test.classes}"/>
</target>
<target name="build" depends="compile-src, compile-test"
description="compiles all source"/>
<target name="test" depends="compile-test"
description="runs all unit tests">
<junit haltonfailure="true">
<classpath refid="project.classpath"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${build.test.classes}" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<target name="compile-src" depends="prepare">
<javac srcdir="${src}" destdir="${build.classes}"
source="${source.level}" debug="${debug}" includeantruntime="false">
<compilerarg value="-Xlint:all"/>
<compilerarg value="-Xlint:-deprecation"/>
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-test" depends="prepare">
<javac srcdir="${test}" destdir="${build.test.classes}"
source="${source.level}" debug="true" includeantruntime="false">
<compilerarg value="-Xlint:all"/>
<compilerarg value="-Xlint:-deprecation"/>
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="product" depends="product-zip, product-doc"
description="generates all product artifacts"/>
<target name="product-prepare" depends="product-clean">
<mkdir dir="${dist}"/>
</target>
<target name="product-clean">
<delete dir="${dist}"/>
</target>
<target name="product-zip" depends="product-jar, tomcat-jar, product-javadoc"
description="generates the product distribution zip archive">
<zip destfile="${dist}/${product.zip}">
<zipfileset dir="${basedir}" prefix="${product}">
<include name="LICENSE.txt"/>
<include name="README.dependencies.txt" />
</zipfileset>
<zipfileset dir="${dist}" includes="${product.jar}" prefix="${product}"/>
<zipfileset dir="${dist}" includes="${tomcat.jar}" prefix="${product}"/>
<zipfileset dir="${src}" prefix="${product}/src"/>
<zipfileset dir="${test}" prefix="${product}/test"/>
<zipfileset dir="${javadoc}" prefix="${product}/doc/api"/>
<zipfileset dir="${vendor.lib}" prefix="${product}/lib">
<include name="**/*.jar"/>
</zipfileset>
<zipfileset dir="${vendor.test.lib}" prefix="${product}/lib">
<include name="**/*.jar"/>
</zipfileset>
</zip>
</target>
<target name="product-jar" depends="build, product-prepare"
description="generates the jar containing product classes">
<jar destfile="${dist}/${product.jar}">
<fileset dir="${build.classes}">
<exclude name="${tomcat.ext.dir}/**/*.class"/>
</fileset>
<fileset dir="${build.test.classes}">
<include name="**/*.class" if="product.jar.includes.tests.flag"/>
</fileset>
</jar>
</target>
<target name="tomcat-jar" depends="build, product-prepare"
description="generates the jar containing the Tomcat extension">
<jar destfile="${dist}/${tomcat.jar}">
<fileset dir="${build.classes}">
<include name="${tomcat.ext.dir}/**/*.class"/>
</fileset>
</jar>
</target>
<target name="product-doc" depends="product-prepare, product-javadoc"
description="generates a WAR containing product documentation">
<war destfile="${dist}/${product.doc.war}" webxml="${doc.web.xml}">
<zipfileset dir="${javadoc}" prefix="api"/>
</war>
</target>
<path id="source.path">
<pathelement location="${src}"/>
<pathelement location="${test}"/>
</path>
<target name="product-javadoc">
<delete dir="${javadoc}"/>
<javadoc sourcepathref="source.path" destdir="${javadoc}"
author="true" version="true" use="true">
<classpath refid="project.classpath"/>
<doctitle><![CDATA[<h1>${javadoc.title}</h1>]]></doctitle>
<bottom><![CDATA[<i>${javadoc.footer}</i>]]></bottom>
</javadoc>
</target>
<target name="install-tomcat-ext" depends="product-jar, tomcat-jar">
<fail unless="catalina.home">
Must set catalina.home property
</fail>
<copy todir="${catalina.home}/${tomcat.common.lib}">
<fileset dir="${dist}">
<include name="${product.jar}"/>
</fileset>
</copy>
<copy todir="${catalina.home}/${tomcat.server.lib}">
<fileset dir="${dist}">
<include name="${tomcat.jar}"/>
</fileset>
</copy>
</target>
</project>