blob: 2a0c4faaff839de2515c0ab48c1cbd254cfa9f80 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001<?xml version="1.0"?>
2
3<!--
4 Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
5 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6
7 This code is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License version 2 only, as
9 published by the Free Software Foundation. Sun designates this
10 particular file as subject to the "Classpath" exception as provided
11 by Sun in the LICENSE file that accompanied this code.
12
13 This code is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 version 2 for more details (a copy is included in the LICENSE file that
17 accompanied this code).
18
19 You should have received a copy of the GNU General Public License version
20 2 along with this work; if not, write to the Free Software Foundation,
21 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22
23 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
24 CA 95054 USA or visit www.sun.com if you need additional information or
25 have any questions.
26-->
27
28
29
30<!-- README - HOW TO USE THIS BUILD FILE
31 . You need Ant 1.5 or higher available in your path
32 . You need a build of Java SE 6 available in your path, or JAVA_HOME set to such a build
33 . cd to the directory containing this build.xml file
34 . Launch the build by typing: ant
35 . Please also read the important comment on basedir definition below.
36 -->
37
38<project name="JMX API Version 1.4 - Java SE 6 implementation"
39 default="jar"
40 basedir="../../../../.."
41 >
42
43 <!-- IMPORTANT: BASEDIR DEFINITION
44 This file is assumed to be in:
45 <src_bundle_dir>/j2se/src/share/classes/javax/management
46 Thus the basedir for this project is defined above as:
47 basedir="../../../../.."
48 in order to be the parent dir of src subdir.
49 Result of the build will be placed in ${basedir}/build_jmx
50 as defined by ${dir.build} property below.
51 -->
52
53 <description>
54 Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
55
56 Description: JMX API Version 1.4 - Source Code from Java SE 6
57 </description>
58
59
60 <!-- build properties -->
61
62 <property name="dir.src"
63 location="${basedir}/src/share/classes" />
64
65 <property name="dir.build"
66 location="${basedir}/build_jmx" />
67
68 <property name="dir.build.lib"
69 location="${dir.build}/lib" />
70
71 <property name="dir.build.classes"
72 location="${dir.build}/classes" />
73
74 <property name="dir.build.cache"
75 location="${dir.build}/cache" />
76
77 <property name="flag.debug"
78 value="on" />
79
80 <property name="flag.debug.level"
81 value="lines,source" />
82
83 <property name="flag.optimize"
84 value="on" />
85
86 <property name="flag.javac.source"
87 value="1.6" />
88
89 <property name="flag.deprecation"
90 value="off" />
91
92 <!-- ANT: when compiling, ignore the classpath in effect when Ant is run
93 and therefore use only the classpath specified in the javac tasks -->
94 <property name="build.sysclasspath"
95 value="ignore" />
96
97
98
99 <!-- Concatenated classpaths: one classpath for each build purpose -->
100
101 <path id="classpath.tobuild.jmx">
102 <!-- EMPTY, NO DEPENDENCY! -->
103 </path>
104
105
106
107 <!-- Convert path objects to string properties for display -->
108
109 <property name="property.classpath.tobuild.jmx" refid="classpath.tobuild.jmx" />
110
111
112
113
114 <!-- ********************* -->
115 <!-- *** BUILD TARGETS *** -->
116 <!-- ********************* -->
117
118
119 <!-- ~~~~~~~~~~~~~~~~~~~~ -->
120 <!-- Initialize the build -->
121
122 <target name="init" >
123
124 <!-- Set the values for build date and time -->
125 <tstamp>
126 <format property="BUILD_DATE" pattern="yyyy.MM.dd_HH:mm:ss_z" />
127 </tstamp>
128
129 <!-- Create the build directory -->
130 <mkdir dir="${dir.build}" />
131
132 <!-- Log the values of all properties to file -->
133 <echoproperties destfile="${dir.build}/properties.log" />
134
135 <!-- Display the values of most important properties -->
136 <echo />
137 <echo>See the contents of ${dir.build}/properties.log for all defined properties.</echo>
138 <echo />
139 <echo message="MAIN JVM DEFAULT SYSTEM PROPERTIES: " />
140 <echo message=" java.runtime.version = ${java.runtime.version}" />
141 <echo message=" java.home = ${java.home}" />
142 <echo message=" os.arch = ${os.arch}" />
143 <echo message=" os.name = ${os.name}" />
144 <echo message=" os.version = ${os.version}" />
145 <echo message=" user.name = ${user.name}" />
146 <echo />
147 <echo message="ANT BUILT-IN PROPERTIES: " />
148 <echo message=" basedir = ${basedir}" />
149 <echo message=" ant.file = ${ant.file}" />
150 <echo message=" ant.version = ${ant.version}" />
151 <echo message=" ant.project.name = ${ant.project.name}" />
152 <echo message=" ant.java.version = ${ant.java.version}" />
153 <echo />
154 <echo message="MAIN ANT BUILD-SET PROPERTIES: " />
155 <echo message=" dir.src = ${dir.src}" />
156 <echo message=" dir.build = ${dir.build}" />
157 <echo message=" classpath.tobuild.jmx = ${property.classpath.tobuild.jmx}" />
158 <echo message=" flag.debug = ${flag.debug}" />
159 <echo message=" flag.debug.level = ${flag.debug.level}" />
160 <echo message=" flag.optimize = ${flag.optimize}" />
161 <echo message=" flag.javac.source = ${flag.javac.source}" />
162 <echo message=" flag.deprecation = ${flag.deprecation}" />
163 <echo message=" BUILD_DATE = ${BUILD_DATE}" />
164
165 </target>
166
167
168
169 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
170 <!-- Call classes subtargets and rmic stubs generation -->
171
172 <target name="classes" depends="init,classes-javac,classes-rmic"
173 description="Call classes subtargets and rmic stubs generation"
174 />
175
176
177 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
178 <!-- Build JMX java files -->
179
180 <target name="classes-javac" depends="init"
181 description="Build JMX java files" >
182
183 <mkdir dir="${dir.build.classes}" />
184
185 <javac srcdir="${dir.src}"
186 destdir="${dir.build.classes}"
187 source="${flag.javac.source}"
188 debug="${flag.debug}"
189 debuglevel="${flag.debug.level}"
190 optimize="${flag.optimize}"
191 includeAntRuntime="no"
192 includeJavaRuntime="no"
193 >
194 <include name="javax/management/**"/>
195 <include name="com/sun/jmx/**"/>
196 </javac>
197
198 </target>
199
200
201 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
202 <!-- Generate RMI JRMP and IIOP stub class files for remote objects -->
203
204 <target name="classes-rmic" depends="init,classes-javac"
205 description="Generate RMI JRMP and IIOP stub class files for remote objects" >
206
207
208 <!-- JRMP Stubs -->
209
210 <rmic base="${dir.build.classes}"
211 classname="javax.management.remote.rmi.RMIConnectionImpl"
212 includeAntRuntime="no"
213 includeJavaRuntime="no"
214 stubversion="1.2"
215 >
216 </rmic>
217
218 <rmic base="${dir.build.classes}"
219 classname="javax.management.remote.rmi.RMIServerImpl"
220 includeAntRuntime="no"
221 includeJavaRuntime="no"
222 stubversion="1.2"
223 >
224 </rmic>
225
226
227 <!-- IIOP Stubs -->
228
229 <rmic base="${dir.build.classes}"
230 classname="javax.management.remote.rmi.RMIConnectionImpl"
231 includeAntRuntime="no"
232 includeJavaRuntime="no"
233 iiop="yes"
234 >
235 </rmic>
236
237 <rmic base="${dir.build.classes}"
238 classname="javax.management.remote.rmi.RMIServerImpl"
239 includeAntRuntime="no"
240 includeJavaRuntime="no"
241 iiop="yes"
242 >
243 </rmic>
244
245 </target>
246
247
248 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
249 <!-- Jar all JMX classes -->
250
251 <target name="jar" depends="init,classes"
252 description="Jar all JMX classes" >
253
254 <mkdir dir="${dir.build.lib}" />
255
256 <jar jarfile="${dir.build.lib}/jmx.jar"
257 update="true"
258 >
259
260 <fileset dir="${dir.build.classes}"
261 includes="**/*.class"
262 />
263
264 <manifest >
265 <attribute name="Build-JDK" value="${java.runtime.version}" />
266 <attribute name="Build-Platform" value="${os.arch} ${os.name} ${os.version}" />
267 <attribute name="Build-User" value="${user.name}" />
268 <section name="common">
269 <attribute name="Sealed" value="true" />
270 <attribute name="Specification-Title" value="JMX(TM) API" />
271 <attribute name="Specification-Version" value="1.4" />
272 <attribute name="Specification-Vendor" value="Sun Microsystems, Inc." />
273 <attribute name="Implementation-Title" value="JMX(TM) API, Java SE 6 implementation" />
274 <attribute name="Implementation-Version" value="${BUILD_DATE} rebuild of Mustang JMX sources" />
275 <attribute name="Implementation-Vendor" value="Source bundle from Sun Microsystems, Inc. - Customer rebuilt" />
276 </section>
277 </manifest>
278 </jar>
279
280 </target>
281
282
283
284 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
285 <!-- Delete only all class files in build/classes directory hierarchy -->
286
287 <target name="clean-classes"
288 description="Delete only all *.class files in build_jmx/classes dir" >
289 <delete>
290 <fileset dir="${dir.build.classes}" includes="**/*.class" />
291 </delete>
292 </target>
293
294
295 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
296 <!-- Delete build directory and all its contents -->
297
298 <target name="clean-all"
299 description="Delete build directory and all its contents" >
300 <delete dir="${dir.build}" />
301 </target>
302
303
304 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
305 <!-- Clean all and build everything -->
306
307 <target name="all" depends="clean-all,jar"
308 description="Clean all and build everything" />
309
310
311</project>
312