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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
<?xml version="1.0"?>
<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
-->
<project name="QMF2 API Implementation" default="api" basedir=".">
<!-- =================================================================== -->
<!-- Note that this requires the QPID_HOME environment variable -->
<!-- to be set and it installs the plugin to $QPID_HOME/lib/plugins -->
<!-- =================================================================== -->
<property environment="env"/>
<property name="qpid.home" location="${env.QPID_HOME}"/>
<property name="qpid.lib" location="${qpid.home}/lib"/>
<property name="qpid.lib.plugins" location="${qpid.lib}/plugins"/>
<!-- =================================================================== -->
<!-- Builds the QMF2 and REST APIs -->
<!-- Use this if you have Qpid version 0.12+ as this doesn't override -->
<!-- the now working latest version of AMQMessageDelegate_0_10. -->
<!-- =================================================================== -->
<target name="api" depends="main-jar, restapi-jar, api-doc">
</target>
<!-- =================================================================== -->
<!-- Builds the QMF2 and REST APIs and the AMQMessageDelegate_0_10 patch.-->
<!-- Use this if you have a Qpid version < 0.12 as it includes the patch -->
<!-- for AMQMessageDelegate_0_10.java that is needed to work with older -->
<!-- Qpid versions. N.B. This task won't compile on later Qoid versions. -->
<!-- =================================================================== -->
<target name="api-patched" depends="main-jar, patch-jar, restapi-jar, api-doc">
</target>
<!-- =================================================================== -->
<!-- Builds the QMF2 and REST APIs plus the QMF2 Agent Plugin to enable -->
<!-- the Java Broker to talk QMF2. -->
<!-- Note that this task only compiles on Qpid Java version > 0.20 -->
<!-- =================================================================== -->
<target name="all" depends="main-jar, restapi-jar, qpid-broker-plugins-management-qmf2-jar, all-doc">
<mkdir dir="${qpid.lib.plugins}"/>
<copy file="build/lib/qmf2.jar" todir="${qpid.lib.plugins}"/>
<copy file="build/lib/qpid-broker-plugins-management-qmf2.jar" todir="${qpid.lib.plugins}"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the main API code -->
<!-- =================================================================== -->
<target name="main">
<mkdir dir="build/scratch/qmf2/classes"/>
<javac srcdir="src/main/java"
destdir="build/scratch/qmf2/classes"
debug="off"
deprecation="on"
includeantruntime="false"
optimize="on">
<classpath location="${qpid.lib}/qpid-all.jar"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Compiles the test code -->
<!-- =================================================================== -->
<target name="test" depends="main">
<mkdir dir="build/scratch/qmf2/testclasses"/>
<javac srcdir="src/test/java"
destdir="build/scratch/qmf2/testclasses"
debug="off"
deprecation="on"
includeantruntime="false"
optimize="on">
<classpath>
<pathelement location="${qpid.lib}/qpid-all.jar"/>
<pathelement location="build/scratch/qmf2/classes"/>
</classpath>
</javac>
</target>
<!-- =================================================================== -->
<!-- Compiles the patch needed for Qpid versions older than 0.12 -->
<!-- =================================================================== -->
<target name="patch">
<mkdir dir="build/scratch/patch"/>
<javac srcdir="src/patch/java"
destdir="build/scratch/patch"
debug="off"
deprecation="on"
includeantruntime="false"
optimize="on">
<classpath location="${qpid.lib}/qpid-all.jar"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Compiles the Java Broker QMF2 Agent Plugin -->
<!-- =================================================================== -->
<target name="qpid-broker-plugins-management-qmf2">
<mkdir dir="build/scratch/qpid-broker-plugins-management-qmf2"/>
<javac srcdir="src/qpid-broker-plugins-management-qmf2/java"
destdir="build/scratch/qpid-broker-plugins-management-qmf2"
debug="off"
deprecation="on"
includeantruntime="false"
optimize="on">
<classpath>
<pathelement location="${qpid.lib}/qpid-all.jar"/>
<pathelement location="build/scratch/qmf2/classes"/>
</classpath>
</javac>
</target>
<!-- =================================================================== -->
<!-- Compiles the HTTP REST API Server -->
<!-- =================================================================== -->
<target name="restapi" depends="main">
<mkdir dir="build/scratch/restapi"/>
<javac srcdir="src/restapi/java"
destdir="build/scratch/restapi"
debug="off"
deprecation="on"
includeantruntime="false"
optimize="on">
<classpath>
<pathelement location="${qpid.lib}/qpid-all.jar"/>
<pathelement location="build/scratch/qmf2/classes"/>
</classpath>
</javac>
</target>
<!-- =================================================================== -->
<!-- Generates the main jars -->
<!-- =================================================================== -->
<target name="main-jar" depends="main, test">
<mkdir dir="build/lib"/>
<jar destfile="build/lib/qmf2.jar" basedir="build/scratch/qmf2/classes">
</jar>
<jar destfile="build/lib/qmf2test.jar" basedir="build/scratch/qmf2/testclasses">
</jar>
</target>
<!-- =================================================================== -->
<!-- Generates the jar for the patch needed by Qpid versions < 0.12 -->
<!-- =================================================================== -->
<target name="patch-jar" depends="patch">
<mkdir dir="build/lib"/>
<jar destfile="build/lib/qpid-client-patch.jar" basedir="build/scratch/patch">
</jar>
</target>
<!-- =================================================================== -->
<!-- Generates the jar for the Java Broker QMF2 Agent Plugin -->
<!-- =================================================================== -->
<target name="qpid-broker-plugins-management-qmf2-jar" depends="qpid-broker-plugins-management-qmf2">
<mkdir dir="build/lib"/>
<jar destfile="build/lib/qpid-broker-plugins-management-qmf2.jar"
basedir="build/scratch/qpid-broker-plugins-management-qmf2">
<service type="org.apache.qpid.server.plugin.PluginFactory"
provider="org.apache.qpid.server.qmf2.QmfManagementFactory"/>
</jar>
</target>
<!-- =================================================================== -->
<!-- Generates the jar for the the HTTP REST API Server -->
<!-- =================================================================== -->
<target name="restapi-jar" depends="restapi">
<mkdir dir="build/lib"/>
<jar destfile="build/lib/restapi.jar" basedir="build/scratch/restapi">
</jar>
</target>
<!-- =================================================================== -->
<!-- Generates Javadoc -->
<!-- =================================================================== -->
<target name="api-doc">
<javadoc packagenames="org.apache.qpid.qmf2.*, org.apache.qpid.restapi.*"
sourcepath="src/main/java:src/restapi/java"
destdir="docs/api"
windowtitle="QMF2 API">
</javadoc>
</target>
<target name="all-doc">
<javadoc packagenames="org.apache.qpid.qmf2.*, org.apache.qpid.restapi.*, org.apache.qpid.server.qmf2.*"
sourcepath="src/main/java:src/restapi/java:src/qpid-broker-plugins-management-qmf2/java"
destdir="docs/api"
windowtitle="QMF2 API">
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Cleans up classes but keeps jars and docs around -->
<!-- =================================================================== -->
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="." includes="**/*.class"/>
</delete>
</target>
<!-- =================================================================== -->
<!-- Removes everything except the sources enabling clean build. -->
<!-- =================================================================== -->
<target name="cleanall" depends="clean, cleanplugin">
<delete includeemptydirs="true">
<fileset dir="." includes="**/*.*~ **/*~" defaultexcludes="no"/>
</delete>
<delete dir="build"/>
<delete dir="docs"/>
</target>
<!-- =================================================================== -->
<!-- If plugins directory exists delete the plugin jars. -->
<!-- =================================================================== -->
<target name="cleanplugin" depends="test-for-plugin" if="dir.exists">
<delete includeemptydirs="true">
<fileset dir="${qpid.lib.plugins}" includes="qpid-broker-plugins-management-qmf2.jar qmf2.jar"
defaultexcludes="no"/>
</delete>
</target>
<!-- =================================================================== -->
<!-- Test for the presence of the plugins directory. -->
<!-- =================================================================== -->
<target name="test-for-plugin">
<condition property="dir.exists">
<available file="${qpid.lib.plugins}" type="dir"/>
</condition>
</target>
</project>
|