This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
292 lines (225 loc) · 10.7 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<?xml version="1.0"?>
<!--
Author: Greg Hinkle
Copyright 2002-2011 Greg Hinkle
Licensed 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.
http://sourceforge.net/projects/mc4j
-->
<project name="mc4j-ems" basedir="." default="jars">
<property name="module.jar" value="org-mc4j-ems.jar"/>
<property name="release.version" value="1.3.6-rhq"/>
<target name="init" description="Initializes the MC4J-EMS build system.">
<echo message="MC4J-EMS Build Environment - Try [ant -projecthelp] for more info."/>
<tstamp/>
<!-- Make sure we have all the directories we need to run a build. -->
<mkdir dir="classes"/>
<path id="classpath.compile">
<fileset dir="lib/build">
<include name="*.jar"/>
</fileset>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<available
property="jre15Available"
classname="java.lang.management.MemoryUsage"
classpathref="classpath.compile"/>
<!-- Check that the required dependencies are installed. -->
<available
classpathref="classpath.compile"
classname="org.openide.DialogDisplayer"
property="installed.netbeans"/>
<fail unless="jre15Available" message="JDK 1.5 or later is required to compile EMS."/>
<property name="compile.target" value="1.5"/>
<property name="compile.source" value="1.5"/>
<!--
<condition property="compile.target" value="jsr14">
<isset property="jre15Available"/>
</condition>
<condition property="compile.target" value="1.4">
<not>
<isset property="jre15Available"/>
</not>
</condition>
<condition property="compile.source" value="1.4">
<not>
<isset property="jre15Available"/>
</not>
</condition>
<condition property="compile.source" value="1.5">
<isset property="jre15Available"/>
</condition>
-->
<echo message="Will compile with target [${compile.target}] and source [${compile.source}]"/>
</target>
<target name="clean" description="Clean">
<delete dir="classes"/>
<delete dir="javadocs"/>
</target>
<target name="compile" depends="init" description="Compiles the MC4J-EMS codebase.">
<mkdir dir="classes"/>
<mkdir dir="classes/main"/>
<mkdir dir="classes/impl"/>
<mkdir dir="classes/test"/>
<javac srcdir="src/ems" destdir="classes/main" debug="true" source="${compile.source}"
target="${compile.target}">
<classpath>
<path refid="classpath.compile"/>
</classpath>
<exclude name="**/DeepClassLoaderOrig*"/>
</javac>
<javac srcdir="src/ems-impl" destdir="classes/impl" debug="true" source="${compile.source}"
target="${compile.target}">
<classpath>
<path refid="classpath.compile"/>
<pathelement location="classes/main"/>
</classpath>
</javac>
<javac srcdir="src/test" destdir="classes/test" debug="true" source="${compile.source}" target="1.5">
<classpath>
<path refid="classpath.compile"/>
<pathelement location="classes/main"/>
</classpath>
</javac>
</target>
<target name="javadoc" depends="init" description="Generated Javadocs for MC4J-EMS classes.">
<mkdir dir="javadocs/api"/>
<mkdir dir="javadocs/impl"/>
<javadoc packagenames="org.mc4j.ems.*"
excludepackagenames="org.mc4j.ems.connection.support.classloader.*"
sourcepath="src/ems"
destdir="javadocs/api"
author="true"
version="true"
use="true"
windowtitle="EMS API">
</javadoc>
<javadoc packagenames="org.mc4j.ems.*"
sourcepath="src/ems-impl"
destdir="javadocs/impl"
author="true"
version="true"
use="true"
windowtitle="EMS Impl">
</javadoc>
</target>
<target name="jars" depends="compile, javadoc" description="Builds the MC4J Module JAR Files">
<mkdir dir="dist"/>
<mkdir dir="build"/>
<delete>
<fileset dir="dist">
<include name="*.jar"/>
</fileset>
</delete>
<jar jarfile="classes/main/org-mc4j-ems-impl.jar" update="true" compress="false">
<fileset dir="classes/impl" includes="org/mc4j/ems/impl/**"/>
<manifest>
<attribute name="Implementation-Title" value="MC4J-EMS"/>
<attribute name="Specification-Version" value="${release.version}"/>
<attribute name="Implementation-Version" value="${release.version}"/>
<attribute name="Implementation-URL" value="http://mc4j.org/"/>
</manifest>
</jar>
<copy file="classes/main/org-mc4j-ems-impl.jar"
tofile="dist/org-mc4j-ems-impl-${release.version}.jar"/>
<jar jarfile="dist/org-mc4j-ems-${release.version}.jar" update="true" compress="false">
<fileset dir="classes/main"/>
<fileset dir="${basedir}" includes="lib/*.jar"/>
<fileset dir="${basedir}" includes="lib/jsr160-includes/*.jar"/>
<manifest>
<attribute name="Implementation-Title" value="MC4J-EMS"/>
<attribute name="Specification-Version" value="${release.version}"/>
<attribute name="Implementation-Version" value="${release.version}"/>
<attribute name="Implementation-URL" value="http://mc4j.org/"/>
</manifest>
</jar>
<copy todir="dist">
<fileset dir="lib" includes="*.jar"/>
</copy>
<!-- sources jars -->
<jar jarfile="dist/org-mc4j-ems-${release.version}-sources.jar" basedir="src/ems"/>
<jar jarfile="dist/org-mc4j-ems-impl-${release.version}-sources.jar" basedir="src/ems-impl"/>
<!-- javadoc jars -->
<jar jarfile="dist/org-mc4j-ems-${release.version}-javadoc.jar" basedir="javadocs/api"/>
<jar jarfile="dist/org-mc4j-ems-impl-${release.version}-javadoc.jar" basedir="javadocs/impl"/>
</target>
<target name="dist" depends="jars" description="Build the EMS distribution"/>
<target name="install" depends="jars" description="Deploys the EMS JAR Files to the Local Maven Repo">
<property name="maven.repo.local" location="${user.home}/.m2/repository"/>
<property name="ems.artifact.dir" location="${maven.repo.local}/mc4j/org-mc4j-ems/${release.version}"/>
<mkdir dir="${ems.artifact.dir}"/>
<property name="ems-impl.artifact.dir" location="${maven.repo.local}/mc4j/org-mc4j-ems-impl/${release.version}"/>
<mkdir dir="${ems-impl.artifact.dir}"/>
<copy todir="${ems.artifact.dir}">
<fileset dir="dist">
<include name="org-mc4j-ems-${release.version}.jar"/>
<include name="org-mc4j-ems-${release.version}-sources.jar"/>
<include name="org-mc4j-ems-${release.version}-javadoc.jar"/>
</fileset>
</copy>
<copy todir="${ems-impl.artifact.dir}">
<fileset dir="dist">
<include name="org-mc4j-ems-impl-${release.version}.jar"/>
<include name="org-mc4j-ems-impl-${release.version}-sources.jar"/>
<include name="org-mc4j-ems-impl-${release.version}-javadoc.jar"/>
</fileset>
</copy>
</target>
<target name="test-classloader" depends="dist">
<java classname="org.mc4j.ems.connection.support.classloader.NestedJarClassLoader" fork="yes">
<classpath>
<path location="dist/org-mc4j-ems-${release.version}.jar"/>
</classpath>
</java>
</target>
<target name="test-AS4">
<!-- this test requires a running JBoss AS 4 kind of server -->
<!-- server is expected to live in /devel/jboss-eap-4.3/jboss-as -->
<!-- and having admin:nimda as credentials to connect to JMX -->
<!-- todo: pull those settings out into <arg> -->
<java classname="org.mc4j.ems.test.ConnectionTest" fork="yes">
<classpath>
<path location="dist/org-mc4j-ems-${release.version}.jar"/>
<pathelement location="lib/commons-logging-1.1.0.jboss.jar"/>
<pathelement location="classes/test"/>
</classpath>
<jvmarg value="-ea"/>
</java>
</target>
<target name="run" description="Directly starts MC4J with the settings as the installer would use.">
<echo>Starting MC4J-EMS Test</echo>
<java
classname="org.mc4j.ems.test.LoaderTest"
fork="yes">
<jvmarg value="-Xms24m"/>
<jvmarg value="-Xmx128m"/>
<env key="JAVA_HOME" value="c:\jdk1.6.0"/>
<!-- Under 1.5 JRE's, this will start up the built-in jmxremoting support -->
<sysproperty key="com.sun.management.jmxremote.port" value="9777"/>
<sysproperty key="com.sun.management.jmxremote.ssl" value="false"/>
<sysproperty key="com.sun.management.jmxremote.authenticate" value="false"/>
<!--<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=NONE"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>-->
<classpath>
<path refid="classpath.compile"/>
<path location="dist/org-mc4j-ems-${release.version}.jar"/>
<pathelement location="lib/commons-logging.jar"/>
<pathelement location="classes/test"/>
<!--<pathelement location="c:\\bea\\weblogic81\\server\\lib\\weblogic.jar"/>-->
<!--<pathelement location="e:\\tools\\weblogic9\\weblogic90b\\server\\lib\\weblogic.jar"/>-->
</classpath>
</java>
</target>
<target name="all-test" depends="compile, jars, run, test-AS4" description="Compile and run the tests."/>
</project>