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

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

<project name="vecmath-1.4.0" default="jar-opt" basedir=".">

  <!-- 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_4_0"/>
  <property name="docname" value="vecmath-${version}-doc"/>
  
  <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"/>

    <!-- Compile the java code from ${src} into ${build}/debug/classes -->
    <javac srcdir="${src}"
           destdir="${build}/debug/classes"	   
	   source="1.4"
	   target="1.4"
	   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"/>

    <!-- Compile the java code from ${src} into ${build}/opt/classes -->
    <javac srcdir="${src}"
           destdir="${build}/opt/classes"	   
	   source="1.4"
	   target="1.4"
           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 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="${src}/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 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="${src}/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-opt" 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>