/[cvs]/jsr166/build.xml
ViewVC logotype

Diff of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by tim, Mon Oct 7 04:07:37 2002 UTC revision 1.14 by tim, Thu Dec 12 20:23:16 2002 UTC
# Line 1  Line 1 
1  <project name="jsr166" default="jar">  <project name="jsr166" default="jar">
2    
3    <description>    <description>
4    
5      Build file for JSR-166      Build file for JSR-166
6    
7        Note that junit.jar must be in ${ant.home}/lib for the
8        test target to work. [FIXME: This should be automatically
9        enforced by this build file by failing with a message if
10        junit.jar is not in the right place.]
11    
12    </description>    </description>
13    
14    <!-- Compilation options -->    <!-- Compilation options -->
15      <property name="build.sourcelevel"    value="1.5"/>
16    <property name="build.debug"          value="true"/>    <property name="build.debug"          value="true"/>
17    <property name="build.debuglevel"     value="source,lines,vars"/>    <property name="build.debuglevel"     value="source,lines,vars"/>
18    <property name="build.deprecation"    value="false"/>    <property name="build.deprecation"    value="false"/>
19    <property name="build.sourcelevel"    value="1.4"/>    <!--
20      <property name="build.warnings"       value="true"/>
21      -->
22    
23    <!-- Build locations -->    <!-- Build locations -->
24    <property name="build.dir"            location="build"/>    <property name="build.dir"            location="build"/>
# Line 26  Line 36 
36    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
37    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
38    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
39      <property name="dist.dir"             location="${basedir}/dist"/>
40    
41      <!-- Distribution locations -->
42      <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
43    
44    <!-- Jar locations -->    <!-- Jar locations -->
45    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
# Line 34  Line 48 
48    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
49    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
50    
51    <property name="gj.compiler.args"    <property name="javac.args"           value='-J-Xbootclasspath/p:${javac.jar}'/>
52             value='-J-Xbootclasspath/p:${javac.jar} -bootclasspath ${collect.jar};${rt.jar} -gj'  
53    />    <path id="javac.bootclasspath">
54        <pathelement location="${collect.jar}"/>
55        <pathelement location="${rt.jar}"/>
56      </path>
57    
58      <path id="test.classpath">
59        <pathelement location="${product.jar}"/>
60      </path>
61    
62    
63      <!-- Main targets -->
64    
65    <target name="compile">    <target name="compile" depends="init"
66              description="Compiles all sources to build folder">
67      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
68      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
69            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
# Line 49  Line 73 
73             source="${build.sourcelevel}"             source="${build.sourcelevel}"
74               fork="true">               fork="true">
75    
76        <compilerarg line="${gj.compiler.args}"/>        <bootclasspath refid="javac.bootclasspath"/>
77          <compilerarg line="${javac.args} ${build.warnings.option}"/>
78    
79        <!-- need this because srcdir is basedir! -->        <!-- need this because srcdir is basedir! -->
80        <include name="java/**/*.java"/>        <include name="java/**/*.java"/>
# Line 58  Line 83 
83    </target>    </target>
84    
85    
86    <target name="jar" depends="compile">    <target name="jar" depends="compile"
87              description="Builds library jar from compiled sources">
88      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.lib.dir}"/>
89      <jar basedir="${build.classes.dir}"      <jar basedir="${build.classes.dir}"
90          destfile="${product.jar}"          destfile="${product.jar}"
# Line 66  Line 92 
92    </target>    </target>
93    
94    
95    <target name="test" depends="report-tests"/>    <target name="test" depends="init, report-tests"
96              description="Runs all tests"/>
97    
98    
99    <target name="docs" depends="filter-src">    <target name="docs" depends="init, clean-filtered-src, filter-src"
100              description="Builds javadocs with custom tags to build folder">
101      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
102      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
103      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
# Line 79  Line 107 
107    
108        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
109        <tag name="spec" description="Specified by:"/>        <tag name="spec" description="Specified by:"/>
110          <tag name="editor" description="Last edited by:"/>
111          <tag name="fixme" description="FIX ME:"/>
112        <packageset dir="${build.filter.src.dir}">        <packageset dir="${build.filter.src.dir}">
113          <include name="java/**"/>          <include name="java/**"/>
114        </packageset>        </packageset>
# Line 88  Line 117 
117    </target>    </target>
118    
119    
120    <target name="clean">    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/>
121    
122    
123      <target name="clean"
124              description="Removes all build products">
125      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
126      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
127      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
     <delete dir="${build.javadocs.dir}"/>  
128    </target>    </target>
129    
130    
131    <!-- Internal targets used by docs target -->    <target name="dist-clean"
132              description="Removes all build and distribution products">
133        <delete dir="${dist.dir}"/>
134      </target>
135    
136    
137      <!-- Anthill targets -->
138    
139      <!-- Should really run the tests instead of just the jar target -->
140      <target name="anthill-build" depends="jar, docs, dist-docs"
141              description="Build the jar and both the external and internal docs"/>
142    
143      <target name="anthill-publish">
144        <copy todir="${deployDir}/docs/private">
145          <fileset dir="${build.javadocs.dir}"/>
146        </copy>
147        <copy todir="${deployDir}/docs/public">
148          <fileset dir="${dist.javadocs.dir}"/>
149        </copy>
150      </target>
151    
152    
153      <!-- Internal targets -->
154    
155      <target name="set-warnings-if" if="build.warnings">
156        <property name="build.warnings.option" value="-warnunchecked"/>
157      </target>
158    
159      <target name="set-warnings-unless" unless="build.warnings">
160        <property name="build.warnings.option" value=""/>
161      </target>
162    
163      <target name="init" depends="set-warnings-if, set-warnings-unless">
164        <!-- Version is kept in a separate file -->
165        <loadfile property="version" srcFile="version.properties"/>
166        <echo>Building JSR-166 version ${version}</echo>
167      </target>
168    
169    <target name="compile-ant">  
170      <target name="clean-filtered-src">
171        <delete dir="${build.filter.src.dir}"/>
172      </target>
173    
174    
175      <target name="dist-jar" depends="clean, jar">
176        <copy file="${product.jar}" todir="${dist.dir}"/>
177      </target>
178    
179    
180      <target name="dist-docs" depends="clean-filtered-src, filter-src"
181              description="Builds javadocs without custom tags to dist folder">
182        <delete dir="${dist.javadocs.dir}"/>
183        <mkdir dir="${dist.javadocs.dir}"/>
184        <javadoc destdir="${dist.javadocs.dir}"
185                    link="http://java.sun.com/j2se/1.4.1/docs/api"
186                overview="${src.dir}/intro.html"
187                  source="${build.sourcelevel}">
188    
189          <packageset dir="${build.filter.src.dir}">
190            <include name="java/**"/>
191          </packageset>
192    
193        </javadoc>
194      </target>
195    
196    
197      <target name="compile-ant-filter">
198      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
199      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
200            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
# Line 107  Line 203 
203    </target>    </target>
204    
205    
206    <target name="filter-src" depends="compile-ant">    <target name="filter-src" depends="compile-ant-filter">
207      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
208      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
209        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
# Line 148  Line 244 
244    </target>    </target>
245    
246    
   <!-- Internal targets used by test target -->  
   
247    <target name="compile-tests" depends="jar">    <target name="compile-tests" depends="jar">
248      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
249      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
# Line 160  Line 254 
254             source="${build.sourcelevel}"             source="${build.sourcelevel}"
255               fork="true">               fork="true">
256    
257        <compilerarg line="${gj.compiler.args}"/>        <bootclasspath refid="javac.bootclasspath"/>
258          <compilerarg line="${javac.args} ${build.warnings.option}"/>
259        <classpath id="test.classpath">        <classpath refid="test.classpath"/>
         <pathelement location="${product.jar}"/>  
         <pathelement location="${junit.jar}"/>  
       </classpath>  
   
260        <include name="**/*Test.java"/>        <include name="**/*Test.java"/>
261    
262      </javac>      </javac>
263    </target>    </target>
264    
265    
266    <target name="run-tests" depends="compile-tests">    <target name="run-tests" depends="compile-tests">
267      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
268      <junit printsummary="true"      <junit printsummary="true"
269               showoutput="true"               showoutput="true"
270            errorProperty="junit.failed"            errorProperty="junit.failed"
271          failureProperty="junit.failed"          failureProperty="junit.failed"
272                      dir="${build.reports.dir}">                      dir="${build.reports.dir}"
273                       fork="true">
274    
275          <jvmarg value="-Xbootclasspath/p:${product.jar}"/>
276    
277        <classpath>        <classpath>
278          <path refid="test.classpath"/>          <!-- <path refid="test.classpath"/> -->
279          <pathelement location="${build.testcases.dir}"/>          <pathelement location="${build.testcases.dir}"/>
280        </classpath>        </classpath>
281    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.14

dl@cs.oswego.edu
ViewVC Help
Powered by ViewVC 1.1.27