summaryrefslogtreecommitdiffstats
path: root/build.xml
blob: 84c402d848b0f21ee455f10d996b855ce93c7b69 (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
<?xml version="1.0"?>

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

<project name="vecmath-1.6.0" default="jar-debug" basedir=".">

  <!-- *************************************** -->
  <!-- *** Begin build-specific properties *** -->
  <!-- *************************************** -->

  <!--
  * The following properties specify the current version of 3D.
  * The "version_base" property specifies the dot-dot base version
  * number of 3D; it must contain exactly three integer numbers
  * separated by "periods ("."). It should match the version base
  * defined in the j3d-core build.xml file.
  -->
  <property name="version_base"       value="1.6.0"/>

  <!-- ************************************* -->
  <!-- *** End build-specific properties *** -->
  <!-- ************************************* -->


  <!-- Set global properties for this build -->
  <property name="src"     location="src"/>
  <property name="build"   location="build"/>
  <property name="dist"    location="dist"/>
  <property name="version" value="1_6_0"/>
  <property name="docname" value="vecmath-${version}-doc"/>
  
  <property name="build.spec.title" value="3D Vector Math Package"/>
  <property name="build.impl.title" value="3D Vector Math Package"/>
  <property name="build.spec.vendor" value=""/>
  <property name="build.impl.vendor" value=""/>
  <property name="build.impl.vendor.id" value=""/>

  <target name="echo">	
    <echo message="user.name = ${user.name}"/>
    <echo message="user.home = ${user.home}"/>
    <echo message="java.home = ${java.home}"/>
    <echo message="ant.home  = ${ant.home}"/>
    <echo message="O/S arch is ${os.arch}"/>
    <echo message="O/S name is ${os.name}"/>
  </target>


  <target name="init">
    <!-- Create the time stamp -->
    <tstamp>
	<format property="buildtime"
		pattern="yyyy-MM-dd'T'HH:mm:ss"/>
    </tstamp>

    <!-- Create the base build directory -->
    <mkdir dir="${build}"/>
  </target>

  <target name="compile-debug" depends="init">

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

    <!-- Compile the java code from ${src} into ${build}/debug/classes -->
    <javac srcdir="${src}"
           destdir="${build}/debug/classes"	   
	   source="1.5"
	   target="1.5"
	   debug="true"
           deprecation="on"
    />

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

  <target name="compile-opt" depends="init">

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

    <!-- Compile the java code from ${src} into ${build}/opt/classes -->
    <javac srcdir="${src}"
           destdir="${build}/opt/classes"	   
	   source="1.5"
	   target="1.5"
           debug="true"
           debuglevel="lines,source"
           deprecation="on"
    />

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

  <target name="compile" depends="compile-opt,compile-debug"/>

  <target name="jar-debug" depends="compile-debug">
    <!-- Create the jar directory -->
    <mkdir dir="${build}/debug/lib/ext"/>

    <copy todir="${build}/debug/gen"
          overwrite="true">
        <fileset dir="${src}" includes="VECMATH.MF"/>
        <filterset>
            <filter token="VERSION_BASE" value="${version_base}"/>
            <filter token="SPEC_TITLE" value="${build.spec.title}"/>
            <filter token="SPEC_VENDOR" value="${build.spec.vendor}"/>
            <filter token="IMPL_TITLE" value="${build.impl.title}"/>
            <filter token="IMPL_VENDOR" value="${build.impl.vendor}"/>
            <filter token="IMPL_VENDOR_ID" value="${build.impl.vendor.id}"/>
        </filterset>
    </copy>

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

    <!-- Put everything in ${build}/debug/classes into the vecmath.jar file -->
    <jar jarfile="${build}/debug/lib/ext/vecmath.jar"
         manifest="${build}/debug/gen/VECMATH.MF" compress="false" update="yes">
	<fileset dir="${build}/debug/classes"/>
    </jar>
  </target>

  <target name="jar-opt" depends="compile-opt">
    <!-- Create the jar directory -->
    <mkdir dir="${build}/opt/lib/ext"/>

    <copy todir="${build}/opt/gen"
          overwrite="true">
        <fileset dir="${src}" includes="VECMATH.MF"/>
        <filterset>
            <filter token="VERSION_BASE" value="${version_base}"/>
            <filter token="SPEC_TITLE" value="${build.spec.title}"/>
            <filter token="SPEC_VENDOR" value="${build.spec.vendor}"/>
            <filter token="IMPL_TITLE" value="${build.impl.title}"/>
            <filter token="IMPL_VENDOR" value="${build.impl.vendor}"/>
            <filter token="IMPL_VENDOR_ID" value="${build.impl.vendor.id}"/>
        </filterset>
    </copy>

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

    <!-- Put everything in ${build}/classes/opt into the vecmath.jar file -->
    <jar jarfile="${build}/opt/lib/ext/vecmath.jar"
         manifest="${build}/opt/gen/VECMATH.MF" compress="false" update="yes">
	<fileset dir="${build}/opt/classes"/>
    </jar>
  </target>

  <target name="jar" depends="jar-opt,jar-debug"/>

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

    <!-- Compile the javadoc from ${src} into ${build}/javadocs -->
    <javadoc sourcepath="${src}"
	     packagenames="javax.vecmath.*"
	     maxmemory="128m"
             destdir="${build}/javadocs"
             windowtitle="Vecmath ${version}">
    </javadoc>

    <!-- Copy the copyright file -->
    <copy todir="${build}/javadocs">
      <fileset dir="." includes="COPYRIGHT.txt"/>
    </copy>
  </target>

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

    <!-- Copy the jar file -->
    <copy file="${build}/opt/lib/ext/vecmath.jar" todir="${dist}/lib/ext"/>

    <!-- Create the docs distribution directory -->
    <mkdir dir="${dist}/javadocs"/>

    <!-- Put everything in ${build}/javadocs into the zip docname file -->
    <zip zipfile="${dist}/javadocs/${docname}.zip" basedir="${build}/javadocs"/>
  </target>

  <target name="all" depends="jar-debug,dist"/>

  <target name="clean-dist">
    <!-- Delete the ${dist} directory tree  -->
    <delete dir="${dist}"/>
  </target>

  <target name="clean">
    <!-- Delete the ${build}, and ${dist} directory trees  -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>

  <description>
The following ant targets are available ("jar-debug" is the default):

      all           - execute targets jar-debug and dist

      clean         - removes WS/build/ and WS/dist/

      clean-dist    - removes WS/dist

      compile       - execute targets compile-debug and compile-opt
 
      compile-debug - builds all classes in WS/src into class files
                      under WS/build/classes/debug

      compile-opt   - builds all classes in WS/src/ into class files 
                      under WS/build/classes/opt

      dist          - creates WS/dist/lib/opt/ext/vecmath.jar
                      from class files under WS/build/classes/opt and
                      creates WS/dist/doc/vecmath-${version}-doc.zip from
		      javadoc under WS/build/javadocs

      docs          - builds all classes in WS/src into javadoc under 
                      WS/build/javadocs

      echo          - echo some useful information, such as user.home,
                      ant.home and java.home

      jar           - execute targets jar-debug and jar-opt

      jar-debug     - creates WS/build/lib/debug/ext/vecmath.jar
                      from class files under WS/build/classes/debug

      jar-opt       - creates WS/build/lib/opt/ext/vecmath.jar
                      from class files under WS/build/classes/opt
  </description>
</project>