This repository has been archived by the owner on Jun 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
261 lines (248 loc) · 8.28 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
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
258
259
260
261
<?xml version="1.0"?>
<!--
OpenAMQ/JMS build file
-->
<project
name = "OpenAMQ/JMS"
default = "jar"
basedir = "."
>
<property name = "version" value = "1.2c1" />
<property name = "lib" value = "${basedir}/lib" />
<property name = "generate.saxon" value = "${lib}/saxon/saxon8.jar" />
<property name = "generate.resources" value = "${basedir}/resources" />
<property name = "generate.spec" value = "${generate.resources}/amqp.0-9.xml" />
<property name = "generate.src" value = "${basedir}/generated/src" />
<property name = "generate.output" value = "${generate.src}/org/openamq/framing" />
<property name = "client.src" value = "${basedir}/src" />
<property name = "client.classes" value = "${basedir}/classes" />
<property name = "tests.src" value = "${basedir}/tests/src" />
<property name = "tests.classes" value = "${basedir}/tests/classes" />
<property name = "dist" value = "${basedir}/dist" />
<property environment = "env" />
<!--
Setup build tree
-->
<target name = "init">
<mkdir dir = "${generate.src}" />
<mkdir dir = "${client.classes}" />
<mkdir dir = "${tests.classes}" />
</target>
<!--
Classpath used to build
-->
<path id = "build.classpath">
<fileset dir = "${lib}">
<include name = "**/*.jar" />
</fileset>
<pathelement path = "${client.classes}" />
<pathelement path = "${tests.classes}" />
</path>
<!--
Clean
-->
<target
name = "clean"
depends = "init"
description = "Clean any generated code and binaries from the build tree"
>
<delete dir = "${basedir}/generated" />
<delete dir = "${client.classes}" />
<delete dir = "${tests.classes}" />
<delete dir = "${dist}" />
</target>
<!--
Generate
-->
<target name = "check-generate">
<uptodate
property = "generate.notRequired"
targetfile = "${generate.output}/results.out"
srcfile = "${generate.spec}"
/>
</target>
<target
name = "generate"
depends = "check-generate"
unless = "generate.notRequired"
description = "Generate framing classes from protocol specification"
>
<mkdir dir = "${generate.src}/org/openamq/client" />
<copy
file = "${generate.resources}/Version.java"
todir = "${generate.src}/org/openamq/client"
/>
<replace
token = "@@version@@"
value = "${version}"
file = "${generate.src}/org/openamq/client/Version.java"
/>
<mkdir dir = "${generate.output}" />
<java jar = "${generate.saxon}" fork = "true">
<arg value = "-o"/>
<arg value = "${generate.output}/results.out" />
<arg value = "${generate.spec}" />
<arg value = "${generate.resources}/framing.xsl" />
<arg value = "asl_base=${asl.base}" />
<arg value = "registry_name=MainRegistry" />
</java>
<java jar = "${generate.saxon}" fork = "true">
<arg value = "-o" />
<arg value = "${generate.output}/registry.out" />
<arg value = "${generate.resources}/registry.template" />
<arg value = "${generate.resources}/registry.xsl" />
</java>
</target>
<!--
Compile
-->
<target
name = "compile"
depends = "init, generate"
description = "Compile client classes"
>
<javac
destdir = "${client.classes}"
target = "1.5"
source = "1.5"
debug = "on"
>
<classpath refid = "build.classpath" />
<src path = "${generate.src}" />
<src path = "${client.src}" />
</javac>
<copy todir = "${client.classes}">
<fileset dir = "${client.src}">
<include name = "log4j.properties" />
<include name = "org/openamq/client/security/DynamicSaslRegistrar.properties" />
<include name = "org/openamq/client/security/CallbackHandlerRegistry.properties" />
</fileset>
</copy>
</target>
<!--
Compile tests
-->
<target
name = "compiletests"
depends = "compile"
description = "Compile test classes"
>
<javac
destdir = "${tests.classes}"
target = "1.5"
source = "1.5"
classpathref = "build.classpath"
debug = "on"
>
<src path = "${tests.src}" />
</javac>
<copy todir = "${tests.classes}">
<fileset dir = "${tests.src}">
<include name = "org/openamq/framing/content.txt" />
</fileset>
</copy>
</target>
<!--
Build JAR archives
-->
<target
name = "jar"
depends = "compiletests"
description = "Build JAR archives in ./dist/"
>
<mkdir dir = "${dist}" />
<manifest file = "${dist}/MANIFEST.MF">
<attribute name = "Built-By" value = "${user.name}" />
<section name = "org.openamq">
<attribute name = "Specification-Title" value = "AMQP" />
<attribute name = "Specification-Version" value = "${version}" />
<attribute name = "Specification-Vendor" value = "AMQP Working Group, http://www.amqp.org/" />
<attribute name = "Implementation-Title" value = "OpenAMQ/JMS" />
<attribute name = "Implementation-Version" value = "${version}" />
<attribute name = "Implementation-Vendor" value = "iMatix Corporation" />
<attribute name = "Implementation-URL" value = "http://www.openamq.org/" />
</section>
</manifest>
<jar
destfile = "${dist}/openamq-jms-${version}.jar"
basedir = "${client.classes}"
manifest = "${dist}/MANIFEST.MF"
/>
<jar
destfile = "${dist}/openamq-jms-tests-${version}.jar"
basedir = "${tests.classes}"
manifest = "${dist}/MANIFEST.MF"
/>
<copy todir = "${dist}">
<fileset dir = "${lib}">
<include name = "**/*.jar" />
</fileset>
</copy>
<path id = "dist.classpath">
<fileset dir = "${dist}">
<include name = "**/*.jar" />
</fileset>
</path>
<manifestclasspath
property = "jar.classpath"
jarfile = "${dist}/openamq-jms-launch.jar"
maxParentLevels = "0"
>
<classpath refid = "dist.classpath" />
</manifestclasspath>
<manifest file = "${dist}/MANIFEST.MF">
<attribute name = "Class-Path" value = "${jar.classpath}" />
<attribute name = "Built-By" value = "${user.name}" />
<section name = "org.openamq">
<attribute name = "Specification-Title" value = "AMQP" />
<attribute name = "Specification-Version" value = "${version}" />
<attribute name = "Specification-Vendor" value = "AMQP Working Group, http://www.amqp.org/" />
<attribute name = "Implementation-Title" value = "OpenAMQ/JMS" />
<attribute name = "Implementation-Version" value = "${version}" />
<attribute name = "Implementation-Vendor" value = "iMatix Corporation" />
<attribute name = "Implementation-URL" value = "http://www.openamq.org/" />
</section>
</manifest>
<jar
destfile = "${dist}/openamq-jms-launch.jar"
manifest = "${dist}/MANIFEST.MF"
/>
</target>
<!--
Install into $IBASE/java/lib
-->
<target
name = "install"
depends = "jar"
if = "env.IBASE"
description = "Install distribution into $IBASE/java/lib"
>
<property name = "install.dir" value = "${env.IBASE}/java/lib" />
<mkdir dir = "${install.dir}" />
<copy todir = "${install.dir}">
<fileset dir = "${dist}">
<include name = "*.jar" />
<include name = "**/*.jar" />
</fileset>
</copy>
</target>
<!--
Build JavaDoc
-->
<target name = "javadoc" depends = "compile, compiletests">
<mkdir dir = "${dist}/doc/api" />
<javadoc
sourcepath = "${client.src}"
destdir = "${dist}/docs/api"
packagenames = "org.openamq.*"
classpathref = "build.classpath"
author = "true"
version = "true"
windowTitle = "OpenAMQ/JMS API"
doctitle = "OpenAMQ/JMS API"
footer = "See <a href="http://www.openamq.org">www.openamq.org</a> for more information."
use = "true"
verbose = "false"
/>
</target>
</project>