summaryrefslogtreecommitdiffstats
path: root/src/classes/build.xml
blob: f2f582de2caf1878450c2e8b109bf5cf466360d4 (plain)
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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<?xml version="1.0"?>

<!--
/*
 * $RCSfile$
 *
 * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
 *
 * Use is subject to license terms.
 *
 * $Revision$
 * $Date$
 * $State$
 */
 -->

<!-- Ant file for building java classes and jar files -->
<project name="Java 3D" default="jar-debug">

  <path id="vecmath.debug.classpath">
    <pathelement location="${vecmath_home}/build/debug/lib/ext/vecmath.jar"/>
  </path>

  <path id="vecmath.opt.classpath">
    <pathelement location="${vecmath_home}/build/opt/lib/ext/vecmath.jar"/>
  </path>

  <target name="compile-debug">

    <!-- Create the debug build directory structure used for compile -->
    <mkdir dir="${build}/${platform}/debug/classes"/>

    <!-- Create the directories used for compiling generated files -->
    <mkdir dir="${build-debug-gen}/tools"/>
    <mkdir dir="${build-debug-gen}/classes/javax/media/j3d"/>

    <!-- Copy VersionInfo.java file and change tags for this build -->
    <copy file="${build-tools}/VersionInfo.java"
          todir="${build-debug-gen}/classes/javax/media/j3d"
          overwrite="true">
        <filterset>
            <filter token="BUILD_TYPE" value="${build.type}"/>
            <filter token="BUILDTIME" value="${buildtime}"/>
            <filter token="BUILDTIME_VERBOSE" value="${buildtime_verbose}"/>
            <filter token="IS_DEBUG" value="true"/>
            <filter token="IS_DEV_PHASE" value="true"/>
            <filter token="IS_PRODUCTION" value="${is_production}"/>
            <filter token="USE_VERBOSE_BUILDTIME" value="${use_verbose_buildtime}"/>
            <filter token="VERSION_BASE" value="${version_base}"/>
            <filter token="VERSION_BUILD" value="${version_build}"/>
            <filter token="VERSION_SUFFIX" value="${version_suffix}"/>
        </filterset>
    </copy>

    <!-- Compile the java code from ${src} into ${build}/${platform}/debug/classes -->
    <javac srcdir="${src}/classes/share:${src}/classes/${wstype}:${jogl.pipeline.srcdir}:${core_utils_src}/classes/share:${build-debug-gen}/classes"
           destdir="${build}/${platform}/debug/classes"
	   source="1.5"
	   target="1.5"
	   debug="true"
           deprecation="off"
           excludes="${javac.excludes}">
	   <classpath refid="vecmath.debug.classpath"/>
    </javac>

    <!-- Copy the I18N property files while retaining package location -->
    <copy todir="${build}/${platform}/debug/classes">
        <fileset dir="${src}/classes/share" includes="**/*.properties"/>
        <fileset dir="${core_utils_src}/classes/share" includes="**/*.properties"/>
    </copy>
  </target>

  <target name="compile-opt">

    <!-- Create the opt build directory structure used for compile -->
    <mkdir dir="${build}/${platform}/opt/classes"/>

    <!-- Create the directories used for compiling generated files -->
    <mkdir dir="${build-opt-gen}/tools"/>
    <mkdir dir="${build-opt-gen}/classes/javax/media/j3d"/>

    <!-- Copy VersionInfo.java file and change tags for this build -->
    <copy file="${build-tools}/VersionInfo.java"
          todir="${build-opt-gen}/classes/javax/media/j3d"
          overwrite="true">
        <filterset>
            <filter token="BUILD_TYPE" value="${build.type}"/>
            <filter token="BUILDTIME" value="${buildtime}"/>
            <filter token="BUILDTIME_VERBOSE" value="${buildtime_verbose}"/>
            <filter token="IS_DEBUG" value="false"/>
            <filter token="IS_DEV_PHASE" value="${is_dev_phase}"/>
            <filter token="IS_PRODUCTION" value="${is_production}"/>
            <filter token="USE_VERBOSE_BUILDTIME" value="${use_verbose_buildtime}"/>
            <filter token="VERSION_BASE" value="${version_base}"/>
            <filter token="VERSION_BUILD" value="${version_build}"/>
            <filter token="VERSION_SUFFIX" value="${version_suffix}"/>
        </filterset>
    </copy>

    <!-- Compile the java code from ${src} into ${build}/${platform}/opt/classes -->
   <javac srcdir="${src}/classes/share:${src}/classes/${wstype}:${jogl.pipeline.srcdir}:${core_utils_src}/classes/share:${build-opt-gen}/classes"            destdir="${build}/${platform}/opt/classes"
           source="1.5"
           target="1.5"
           debug="true"
           debuglevel="lines,source"
           deprecation="off"
           excludes="${javac.excludes}">
           <classpath refid="vecmath.opt.classpath"/>
    </javac>
                                                                                                     
    <!-- Copy the I18N property files while retaining package location -->
    <copy todir="${build}/${platform}/opt/classes">
        <fileset dir="${src}/classes/share" includes="**/*.properties"/>
        <fileset dir="${core_utils_src}/classes/share" includes="**/*.properties"/>
    </copy>
  </target>


  <target name="jar-debug" depends="jar-debug-impl,copy-default-debug"/>

  <target name="jar-debug-impl">
    <!-- Create the j3dcore and j3dutils jars directory -->
    <mkdir dir="${build}/${platform}/debug/lib/ext"/>

    <copy todir="${build-debug-gen}"
          overwrite="true">
        <fileset dir="${src}/classes" includes="J3dVersion"/>
        <fileset dir="${core_utils_src}/classes" includes="ToolsVersion"/>
        <filterset>
            <filter token="VERSION_BASE" value="${version_base}"/>
        </filterset>
    </copy>

    <!-- Copy the copyright file and all license files for j3dcore.jar -->
    <copy todir="${build}/${platform}/debug/classes/javax">
      <fileset dir="${src}/.." includes="COPYRIGHT.txt"/>
      <fileset dir="${src}/.." includes="*LICENSE*.txt"/>
    </copy>

    <!-- Copy the copyright file and all license files for j3dutils.jar -->
    <copy todir="${build}/${platform}/debug/classes/com">
      <fileset dir="${core_utils_home}" includes="COPYRIGHT.txt"/>
      <fileset dir="${core_utils_home}" includes="*LICENSE*.txt"/>
    </copy>

    <!-- Put everything in ${build}/${platform}/debug/classes/javax into the j3dcore.jar file -->
    <jar jarfile="${build}/${platform}/debug/lib/ext/j3dcore.jar"
         manifest="${build-debug-gen}/J3dVersion" update="no"
	 compress="false">
	<fileset dir="${build}/${platform}/debug/classes" includes="javax/**/*"/>
    </jar>

    <!-- Put everything in ${build}/${platform}/debug/classes/com into the j3dutils.jar file -->
    <jar jarfile="${build}/${platform}/debug/lib/ext/j3dutils.jar"
         manifest="${build-debug-gen}/ToolsVersion" update="no"
 	 compress="false">
	<fileset dir="${build}/${platform}/debug/classes" includes="com/**/*"/>
    </jar>
  </target>

  <target name="copy-default-debug" unless="build.concurrent">
    <!-- Copy platform-specific jar and native files to "default" directory -->
    <delete dir="${build}/default/debug" quiet="true"/>
    <mkdir dir="${build}/default/debug/native"/>
    <copy todir="${build}/default/debug" overwrite="true">
      <fileset dir="${build}/${platform}/debug" includes="lib/ext/**/*.jar"/>
      <fileset dir="${build}/${platform}/debug" includes="gen/classes/**/*.java"/>
    </copy>
    <copy todir="${build}/default/debug/native" overwrite="true" includeemptydirs="false" flatten="true">
      <fileset dir="${build}/${platform}/debug" includes="lib/** bin/**" excludes="**/*.jar"/>
    </copy>
  </target>

  <target name="jar-opt" depends="jar-opt-impl,copy-default-opt"/>

  <target name="jar-opt-impl">
    <!-- Create the j3dcore and j3dutils jars directory -->
    <mkdir dir="${build}/${platform}/opt/lib/ext"/>

    <copy todir="${build-opt-gen}"
          overwrite="true">
        <fileset dir="${src}/classes" includes="J3dVersion"/>
        <fileset dir="${core_utils_src}/classes" includes="ToolsVersion"/>
        <filterset>
            <filter token="VERSION_BASE" value="${version_base}"/>
        </filterset>
    </copy>

    <!-- Copy the copyright file and all license files for j3dcore.jar -->
    <copy todir="${build}/${platform}/opt/classes/javax">
      <fileset dir="${src}/.." includes="COPYRIGHT.txt"/>
      <fileset dir="${src}/.." includes="*LICENSE*.txt"/>
    </copy>

    <!-- Copy the copyright file and all license files for j3dutils.jar -->
    <copy todir="${build}/${platform}/opt/classes/com">
      <fileset dir="${core_utils_home}" includes="COPYRIGHT.txt"/>
      <fileset dir="${core_utils_home}" includes="*LICENSE*.txt"/>
    </copy>

    <!-- Put everything in ${build}/${platform}/opt/classes/javax into the j3dcore.jar file -->
    <jar jarfile="${build}/${platform}/opt/lib/ext/j3dcore.jar"
         manifest="${build-opt-gen}/J3dVersion" update="no"
	 compress="false">
	<fileset dir="${build}/${platform}/opt/classes" includes="javax/**/*"/>
    </jar>

    <!-- Put everything in ${build}/${platform}/opt/classes/com into the j3dutils.jar file -->
    <jar jarfile="${build}/${platform}/opt/lib/ext/j3dutils.jar"
         manifest="${build-opt-gen}/ToolsVersion" update="no"
         compress="false">
        <fileset dir="${build}/${platform}/opt/classes" includes="com/**/*"/>
    </jar>
  </target>

  <target name="copy-default-opt" unless="build.concurrent">
    <!-- Copy platform-specific jar and native files to "default" directory -->
    <delete dir="${build}/default/opt" quiet="true"/>
    <mkdir dir="${build}/default/opt/native"/>
    <copy todir="${build}/default/opt" overwrite="true">
      <fileset dir="${build}/${platform}/opt" includes="lib/ext/**/*.jar"/>
      <fileset dir="${build}/${platform}/opt" includes="gen/classes/**/*.java"/>
    </copy>
    <copy todir="${build}/default/opt/native" overwrite="true" includeemptydirs="false" flatten="true">
      <fileset dir="${build}/${platform}/opt" includes="lib/** bin/**" excludes="**/*.jar"/>
    </copy>
  </target>

  <target name="setup-docs">
    <property name="javadoc.bottom"
       value="&lt;font size=&quot;-1&quot;&gt;Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to &lt;a href=&quot;{@docRoot}/LICENSE-SPEC.html&quot;&gt;license terms&lt;/a&gt;."/>
  </target>

  <target name="docs-jcp" depends="setup-docs">
    <!-- Create the build directory structure used by docs -->
    <mkdir dir="${build}/${platform}/javadocs/docs-jcp"/>

    <!-- Compile the javadoc from ${src} into ${build}/javadocs -->
    <javadoc packagenames="javax.media.j3d.*,
                           javax.vecmath.*"
             maxmemory="128m"
             destdir="${build}/${platform}/javadocs/docs-jcp"
	     bottom="${javadoc.bottom}"
             windowtitle="Java 3D ${version}">
	     <sourcepath>
		<pathelement location="${src}/classes/share"/>
		<pathelement location="${src}/classes/${wstype}"/>
		<pathelement location="${core_utils_src}/classes/share"/>
		<pathelement location="${vecmath_src}"/>
             </sourcepath>
    </javadoc>

    <!-- Copy the copyright and license files -->
    <copy todir="${build}/${platform}/javadocs/docs-jcp">
      <fileset dir="${src}/.." includes="COPYRIGHT.txt"/>
      <fileset dir="${src}/.." includes="LICENSE-SPEC.html"/>
    </copy>
  </target>

  <target name="docs-private" depends="setup-docs">
    <!-- Create the build directory structure used by docs -->
    <mkdir dir="${build}/${platform}/javadocs/docs-private"/>

    <!--
      ** TODO: there is an implicit dependency on "compile-opt",
      ** since the J3dBuildInfo source file is only built as part of
      ** that target. We don't want to make this an explicit
      ** dependency because we don't want the time stamp regenerated.
      **
      ** Ideally, we should make a "time-stamp-opt" target that only
      ** creates J3DBuildInfo.java if it doesn't exist, and a
      ** "force-time-stamp-opt" target that unconditionally creates
      ** it. The "docs-*" targets would depend on "time-stamp-opt"
      ** while the "compile-opt" target would depend on
      ** "force-time-stamp-opt"
      -->

    <!-- Compile the javadoc from ${src} into ${build}/javadocs -->
    <javadoc packagenames="javax.media.j3d.*,
                           com.sun.j3d.*,
                           javax.vecmath.*"
             maxmemory="128m"
	     private="true"
             destdir="${build}/${platform}/javadocs/docs-private"
	     bottom="${javadoc.bottom}"
             windowtitle="Java 3D ${version}">
	     <sourcepath>
		<pathelement location="${src}/classes/share"/>
		<pathelement location="${src}/classes/${wstype}"/>
		<pathelement location="${build}/${platform}/opt/gen/classes"/>
		<pathelement location="${core_utils_src}/classes/share"/>
		<pathelement location="${vecmath_src}"/>
             </sourcepath>
    </javadoc>

    <!-- Copy the copyright and license files -->
    <copy todir="${build}/${platform}/javadocs/docs-private">
      <fileset dir="${src}/.." includes="COPYRIGHT.txt"/>
      <fileset dir="${src}/.." includes="LICENSE-SPEC.html"/>
    </copy>
  </target>

  <target name="docs-public" depends="setup-docs">
    <!-- Create the build directory structure used by docs -->
    <mkdir dir="${build}/${platform}/javadocs/docs-public"/>

    <!-- Compile the javadoc from ${src} into ${build}/javadocs -->
    <javadoc packagenames="javax.media.j3d.*,
			   com.sun.j3d.audioengines.*,
                           com.sun.j3d.exp.*,
			   com.sun.j3d.loaders.*,
			   com.sun.j3d.utils.*,
                           javax.vecmath.*"
             excludepackagenames="com.sun.j3d.utils.scenegraph.io.retained,
			   com.sun.j3d.exp.swing.impl,
			   com.sun.j3d.utils.scenegraph.io.state.*"
             maxmemory="128m"
             destdir="${build}/${platform}/javadocs/docs-public"
	     bottom="${javadoc.bottom}"
             windowtitle="Java 3D ${version}">
	     <sourcepath>
		<pathelement location="${src}/classes/share"/>
		<pathelement location="${src}/classes/${wstype}"/>
		<pathelement location="${core_utils_src}/classes/share"/>
		<pathelement location="${vecmath_src}"/>
             </sourcepath>
    </javadoc>

    <!-- Copy the copyright and license files -->
    <copy todir="${build}/${platform}/javadocs/docs-public">
      <fileset dir="${src}/.." includes="COPYRIGHT.txt"/>
      <fileset dir="${src}/.." includes="LICENSE-SPEC.html"/>
    </copy>
  </target>

  <target name="docs" depends="docs-jcp,docs-public,docs-private"/>

  <target name="dist-common-jar">
     <!-- Create the distribution directory -->
    <mkdir dir="${dist}/common/lib/ext"/>

    <!--
     * Create a new j3dcore jar file from the linux-i586 platform files plus
     * the Win32* class files. We assume that the manifest file, the license files,
     * and the copyright files have been copied into the libux-i586 build directory
    -->
    <jar jarfile="${dist}/common/lib/ext/j3dcore.jar"
         manifest="${build}/linux-i586/opt/gen/J3dVersion" update="no"
	 compress="false">
	<fileset dir="${build}/linux-i586/opt/classes" includes="javax/**/*"/>
	<fileset dir="${build}/windows-i586-vc/opt/classes" includes="javax/**/Win32*.class"/>
    </jar>

    <!-- Copy the vecmath and j3dutils jar files -->
    <copy todir="${dist}/common/lib/ext">
      <fileset dir="${build}/linux-i586/opt/lib/ext" includes="j3dutils.jar"/>
      <fileset dir="${vecmath_home}/build/opt/lib/ext" includes="vecmath.jar"/>
    </copy>

  </target>
  
  <target name="dist-common-sign" unless="releaseType_daily">
    <property name="staging" location="../../staging"/>
    <exec dir="${dist}/common/lib/ext" executable="${shell}">
      <arg line="${staging}/doSignJars.sh *.jar"/>
    </exec>
  </target>
  
  <target name="dist-common" depends="dist-common-jar,dist-common-sign">
  </target>

  <target name="dist">
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/${platform}/lib/ext"/>

    <!-- Copy the jar files -->
    <copy todir="${dist}/${platform}/lib/ext">
      <fileset dir="${dist}/common/lib/ext" includes="*.jar"/>
    </copy>
  </target>

  <target name="install-debug">
    <copy todir="${java.home}/lib/ext">
        <fileset dir="${build}/${platform}/debug/lib/ext" includes="*.jar"/>
        <fileset dir="${vecmath_home}/build/debug/lib/ext" includes="vecmath.jar"/>
    </copy>
    <copy todir="${java.home}/${install.bin}">
       <fileset dir="${build}/${platform}/debug/${install.bin}" includes="*"/>
    </copy>
  </target>
 
  <target name="install-opt">
    <copy todir="${java.home}/lib/ext">
        <fileset dir="${build}/${platform}/opt/lib/ext" includes="*.jar"/>
        <fileset dir="${vecmath_home}/build/opt/lib/ext" includes="vecmath.jar"/>
    </copy>
    <copy todir="${java.home}/${install.bin}">
       <fileset dir="${build}/${platform}/opt/${install.bin}" includes="*"/>
    </copy>
  </target>
 
  <target name="uninstall">
    <delete>
        <fileset dir="${java.home}/lib/ext" includes="j3dcore.jar, j3dutils.jar, vecmath.jar"/>
    </delete>
    <delete>
       <fileset dir="${java.home}/${install.bin}" includes="libj3dcore*.so"/>
       <fileset dir="${java.home}/${install.bin}" includes="j3dcore*.dll"/>
    </delete>
  </target>
 
</project>