-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
230 lines (208 loc) · 8.66 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!--
* ====================================================================
*
* The P6Spy Software License, Version 1.1
*
* This license is derived and fully compatible with the Apache Software
* license, see http://www.apache.org/LICENSE.txt
*
* Copyright (c) 2001-2002 Andy Martin, Ph.D. and Jeff Goke
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "The original concept and code base for P6Spy was conceived
* and developed by Andy Martin, Ph.D. who generously contribued
* the first complete release to the public under this license.
* This product was due to the pioneering work of Andy
* that began in December of 1995 developing applications that could
* seamlessly be deployed with minimal effort but with dramatic results.
* This code is maintained and extended by Jeff Goke and with the ideas
* and contributions of other P6Spy contributors.
* (http://www.p6spy.com)"
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "P6Spy", "Jeff Goke", and "Andy Martin" must not be used
* to endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
*
* 5. Products derived from this software may not be called "P6Spy"
* nor may "P6Spy" appear in their names without prior written
* permission of Jeff Goke and Andy Martin.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
-->
<project name="p6spy" default="jar" basedir=".">
<property environment="env"/>
<property file="build.properties"/>
<target name="init">
<echo message="--------- Preparing to Build P6Spy ---------"/>
<echo message=""/>
<echo message="java.class.path = ${java.class.path}"/>
<echo message=""/>
<echo message="java.home = ${java.home}"/>
<echo message="user.home = ${user.home}"/>
<echo message="Creating build directory ${build}"/>
<mkdir dir="${build}"/>
<echo message="Creating dist directory ${dist}"/>
<mkdir dir="${dist}"/>
<echo message="Creating javadoc directory ${javadocs}"/>
<mkdir dir="${javadocs}"/>
<echo>
--------- Required jar files ---------
The p6spy build requires several jars in the lib
directory. Below is a list of these jar files and
their corresponding URL's as of November 2003:
JUnit http://www.junit.org/
Jakarta Regexp http://jakarta.apache.org/regexp/
Gnu Regexp http://www.cacas.org/java/gnu/regexp/
Log4j http://jakarta.apache.org/log4j/
Jboss 2.4.6 : jboss.jar http://sourceforge.net/project/showfiles.php?group_id=22866
Sun JMX libraries http://java.sun.com/products/JavaManagement/download.html
Additionally, you will need your database driver jar in the lib
directory to have a complete build.
</echo>
<path id="classpath">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
</target>
<target name="compile" depends="init">
<echo message="--------- Compiling P6Spy ---------"/>
<echo message=""/>
<javac srcdir="${src}" destdir="${build}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}" fork="${forkjavac}">
<classpath refid="classpath"/>
<exclude name="**/test/**" />
<include name="com/**"/>
</javac>
</target>
<target name="jar" depends="compile">
<jar jarfile="${dist}/p6spy.jar" basedir="${build}">
<exclude name="**/test/**" />
<include name="com/**"/>
</jar>
</target>
<target name="docs" depends="jar">
<echo message="--------- Creating Javadocs ---------"/>
<echo message=""/>
<javadoc packagenames="com.p6spy.engine.spy.*,com.p6spy.engine.common.*,com.p6spy.engine.logging.*,com.p6spy.engine.outage.*" sourcepath="${src}" destdir="${javadocs}" />
</target>
<target name="webapp" depends="jar">
<war destfile="${dist}/p6spy.war" webxml="${webapp}/WEB-INF/web.xml">
<fileset dir="${webapp}" includes="**/*.jsp" />
<lib dir="${dist}" includes="p6spy.jar" />
</war>
</target>
<target name="release" depends="docs,webapp">
<echo message="--------- Creating Release Packages ---------"/>
<echo message=""/>
<zip zipfile="${dist}/p6spy-install.zip">
<fileset dir="${dist}" includes="p6spy.jar" />
<fileset dir="${dist}" includes="p6spy.war" />
<fileset dir="${docs}" />
<fileset dir="." includes="license.txt" />
<fileset dir="." includes="spy.properties" />
<fileset dir="." includes="spy.forms" />
</zip>
<jar jarfile="${dist}/p6spy-install.jar">
<fileset dir="${dist}" includes="p6spy.jar" />
<fileset dir="${dist}" includes="p6spy.war" />
<fileset dir="." includes="license.txt" />
<fileset dir="." includes="spy.properties" />
<fileset dir="." includes="spy.forms" />
<fileset dir="${docs}" />
</jar>
<zip zipfile="${dist}/p6spy-src.zip">
<zipfileset dir="${src}" includes="**/*.java,**/*.xml,**/*.txt,**/*.jsp,**/*.properties" />
<zipfileset dir="${javadocs}" prefix="javadocs" />
<zipfileset dir="${docs}" prefix="documentation" />
</zip>
<jar jarfile="${dist}/p6spy-src.jar">
<zipfileset dir="${src}" includes="**/*.java,**/*.xml,**/*.txt,**/*.jsp,**/*.properties" />
<zipfileset dir="${javadocs}" prefix="javadocs" />
<zipfileset dir="${docs}" prefix="documentation" excludes="**/*.xml" />
</jar>
</target>
<target name="test" depends="compile">
<javac srcdir="${src}" destdir="${build}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}" fork="${forkjavac}">
<classpath refid="classpath"/>
<include name="**\test\*.java" />
</javac>
<java classname="junit.textui.TestRunner" fork="yes">
<arg value="-noloading" />
<arg value="${testclass}" />
<classpath>
<pathelement path="${build}"/>
<path refid="classpath"/>
</classpath>
</java>
</target>
<target name="perform" depends="compile">
<javac srcdir="${src}" destdir="${build}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}" fork="${forkjavac}">
<classpath refid="classpath"/>
<include name="**\test\*.java" />
</javac>
<java classname="junit.textui.TestRunner" fork="yes">
<arg value="-noloading" />
<arg value="com.p6spy.engine.test.P6TestPerform" />
<classpath>
<pathelement path="${build}"/>
<path refid="classpath"/>
</classpath>
</java>
</target>
<target name="clean">
<echo message="--------- Removing build files ---------"/>
<echo message=""/>
<delete includeEmptyDirs="true" failonerror="${quitonfail}">
<fileset dir="${build}"/>
</delete>
<echo message=""/>
<echo message="--------- Removing javadocs ---------"/>
<echo message=""/>
<delete includeEmptyDirs="true" failonerror="${quitonfail}">
<fileset dir="${javadocs}"/>
</delete>
<echo message=""/>
<echo message="--------- Removing distribution files ---------"/>
<echo message=""/>
<delete includeEmptyDirs="true" failonerror="${quitonfail}">
<fileset dir="${dist}"/>
</delete>
<echo message=""/>
<echo message="--------- Removing tool generated backup files ---------"/>
<echo message=""/>
<delete failonerror="${quitonfail}">
<fileset dir="${src}" includes="**/*~" defaultexcludes="no"/>
<fileset dir="${src}" includes="**/*.nbattrs" defaultexcludes="no"/>
<fileset dir="${src}" includes="**/*.bak" defaultexcludes="no"/>
<fileset dir="${src}" includes="**/*.swp" defaultexcludes="no"/>
</delete>
</target>
</project>