-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
119 lines (101 loc) · 4.48 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of Zapcat.
Zapcat is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
Zapcat 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 General Public License for more
details.
You should have received a copy of the GNU General Public License along
with Zapcat. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="zapcat" default="all">
<description>
Build the Zapcat library. You can even use this to run the sample programs.
</description>
<property name="version" value="1.3-beta-standalone" />
<property name="jar" value="zapcat-${version}.jar" />
<property name="war" value="zapcat-${version}.war" />
<property name="of" value="zapcat-openfire-${version}.jar" />
<target name="clean" description="clean build dir">
<delete failonerror="false" dir="build" />
</target>
<target name="distclean" description="clean build dir and generated libraries" depends="clean">
<delete failonerror="false" file="${jar}" />
<delete failonerror="false" file="${war}" />
</target>
<target name="jar" description="compile and jar the library" depends="clean">
<mkdir dir="build/jar" />
<javac destdir="build/jar" srcdir="src" debug="true">
<classpath>
<!-- <pathelement location="lib/log4j-1.2.15.jar" /> -->
<pathelement location="lib/servlet-api.jar" />
<pathelement location="lib/ostermillerutils_1_07_00.jar" />
<pathelement location="lib/junit-4.4.jar" />
</classpath>
</javac>
<!-- We don't need the Openfire stubs. The only serve to make our code compile. -->
<jar destfile="${jar}" basedir="build/jar" excludes="org/jivesoftware/**" />
</target>
<target name="war" description="build the war file" depends="jar">
<copy todir="build">
<fileset dir="." includes="webapp/**" />
</copy>
<mkdir dir="build/webapp/WEB-INF/lib" />
<!--<copy file="lib/log4j-1.2.15.jar" todir="build/webapp/WEB-INF/lib" />-->
<copy file="${jar}" todir="build/webapp/WEB-INF/lib" />
<jar destfile="${war}" basedir="build/webapp" />
</target>
<target name="of" description="build the Openfire plugin" depends="jar">
<copy todir="build">
<fileset dir="openfire" includes="zapcat/**" />
</copy>
<mkdir dir="build/zapcat/lib" />
<!--<copy file="lib/log4j-1.2.15.jar" todir="build/zapcat/lib" />-->
<copy file="${jar}" todir="build/zapcat/lib" />
<jar destfile="${of}" basedir="build/zapcat" />
</target>
<target name="all" description="compile the lot" depends="jar,war,of" />
<target name="deploy_war" depends="war" description="Deploys war to application server deploy directory">
<fail unless="deploy.dir">deploy.dir not set</fail>
<copy todir="${deploy.dir}">
<fileset dir=".">
<include name="${war}"/>
</fileset>
</copy>
</target>
<target name="agent" depends="jar" description="run the zapcat agent sample">
<mkdir dir="build/samples" />
<javac destdir="build/samples" srcdir="samples" classpath="${jar}" debug="true" />
<!--<copy todir="build/samples" file="samples/log4j.xml" /> -->
<java classname="SampleAgent" fork="true">
<jvmarg value="-Dcom.sun.management.jmxremote" />
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false" />
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false" />
<classpath>
<pathelement path="build/samples" />
<pathelement location="${jar}" />
<!--<pathelement location="lib/log4j-1.2.15.jar" />-->
</classpath>
</java>
</target>
<target name="trapper" depends="jar" description="run the zapcat trapper sample">
<mkdir dir="build/samples" />
<javac destdir="build/samples" srcdir="samples" classpath="${jar}" debug="true" />
<!--<copy todir="build/samples" file="samples/log4j.xml" />-->
<java classname="SampleTrapper" fork="true">
<jvmarg value="-Dcom.sun.management.jmxremote" />
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false" />
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false" />
<classpath>
<pathelement path="build/samples" />
<pathelement location="${jar}" />
<!--<pathelement location="lib/log4j-1.2.15.jar" />-->
<pathelement location="lib/ostermillerutils_1_07_00.jar" />
</classpath>
</java>
</target>
</project>