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

Diff of /jsr166/build.xml

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

revision 1.8, Wed Dec 11 04:43:23 2002 UTC revision 1.16, Fri Dec 13 06:34:04 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      Note that junit.jar must be in ${ant.home}/lib for the
8      test target to work. [FIXME: This should be automatically      test target to work. [FIXME: This should be automatically
9      enforced by this build file by failing with a message if      enforced by this build file by failing with a message if
10      junit.jar is not in the right place.]      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.5"/>    <!--
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 21  Line 26 
26    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
27    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
28    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <property name="build.ant.dir"        location="${build.dir}/ant"/>
29    <property name="build.pubdocs.dir"    location="${build.dir}/javadocs"/>    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
30    <property name="build.privdocs.dir"   location="${build.dir}/privdocs"/>    <property name="build.stripped.dir"   location="${build.dir}/stripped"/>
31    <property name="build.reports.dir"    location="${build.dir}/reports"/>    <property name="build.reports.dir"    location="${build.dir}/reports"/>
32      <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
33    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
34    
35    <!-- Source locations -->    <!-- Source locations -->
# Line 32  Line 38 
38    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
39    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
40    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
41      <property name="dist.dir"             location="${basedir}/dist"/>
42    
43      <!-- Distribution locations -->
44      <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
45    
46    <!-- Jar locations -->    <!-- Jar locations -->
47    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
# Line 40  Line 50 
50    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
51    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
52    
53    <property name="gj.compiler.args"    <property name="javac.args"           value='-J-Xbootclasspath/p:${javac.jar}'/>
            value='-J-Xbootclasspath/p:${javac.jar} -deprecation -warnunchecked'  
   />  
54    
55    <path id="gj.compiler.bootclasspath">    <path id="javac.bootclasspath">
56      <pathelement location="${collect.jar}"/>      <pathelement location="${collect.jar}"/>
57      <pathelement location="${rt.jar}"/>      <pathelement location="${rt.jar}"/>
58    </path>    </path>
# Line 54  Line 62 
62    </path>    </path>
63    
64    
65    <target name="compile">    <!-- Main targets -->
66    
67      <target name="compile" depends="init"
68              description="Compiles all sources to build folder">
69      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
70      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
71            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
# Line 64  Line 75 
75             source="${build.sourcelevel}"             source="${build.sourcelevel}"
76               fork="true">               fork="true">
77    
78        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
79        <compilerarg line="${gj.compiler.args}"/>        <compilerarg line="${javac.args} ${build.warnings.option}"/>
80    
81        <!-- need this because srcdir is basedir! -->        <!-- need this because srcdir is basedir! -->
82        <include name="java/**/*.java"/>        <include name="java/**/*.java"/>
# Line 74  Line 85 
85    </target>    </target>
86    
87    
88    <target name="jar" depends="compile">    <target name="jar" depends="compile"
89              description="Builds library jar from compiled sources">
90      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.lib.dir}"/>
91      <jar basedir="${build.classes.dir}"      <jar basedir="${build.classes.dir}"
92          destfile="${product.jar}"          destfile="${product.jar}"
# Line 82  Line 94 
94    </target>    </target>
95    
96    
97    <target name="test" depends="report-tests"/>    <target name="test" depends="init, report-tests"
98              description="Runs all tests"/>
99    
   <target name="docs" depends="public-docs, private-docs"/>  
100    
101    <target name="public-docs" depends="clean-docs, filter-src">    <target name="checkstyle" depends="filter-src"
102      <delete dir="${build.pubdocs.dir}"/>            description="Reports on style errors in Java source">
103      <mkdir dir="${build.pubdocs.dir}"/>      <taskdef resource="checkstyletask.properties"
104      <javadoc destdir="${build.pubdocs.dir}"              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
105                  link="http://java.sun.com/j2se/1.4.1/docs/api"  
106              overview="${src.dir}/intro.html"      <checkstyle>
107                source="${build.sourcelevel}">        <formatter type="plain"/>  <!-- also available: type="xml" -->
108          <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
109        </checkstyle>
110      </target>
111    
112    
113      <target name="doccheck" depends="filter-src"
114              description="Reports on javadoc style errors">
115        <delete dir="${build.doccheck.dir}"/>
116        <mkdir dir="${build.doccheck.dir}"/>
117        <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
118             docletpath="${lib.dir}/doccheck.jar"
119                destdir="${build.doccheck.dir}">
120        <packageset dir="${build.filter.src.dir}">        <packageset dir="${build.filter.src.dir}">
121          <include name="java/**"/>          <include name="java/**"/>
122        </packageset>        </packageset>
   
123      </javadoc>      </javadoc>
124    </target>    </target>
125    
126    
127    <target name="private-docs" depends="clean-docs, filter-src">    <target name="docs" depends="filter-src"
128      <delete dir="${build.privdocs.dir}"/>            description="Builds javadocs with custom tags to build folder">
129      <mkdir dir="${build.privdocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
130      <javadoc destdir="${build.privdocs.dir}"      <mkdir dir="${build.javadocs.dir}"/>
131        <javadoc destdir="${build.javadocs.dir}"
132                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://java.sun.com/j2se/1.4.1/docs/api"
133              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
134                source="${build.sourcelevel}">                source="${build.sourcelevel}">
# Line 122  Line 145 
145    </target>    </target>
146    
147    
148    <target name="clean" depends="clean-docs">    <target name="strip" depends="init">
149        <mkdir dir="${build.stripped.dir}"/>
150        <javac srcdir="${src.dir}"
151              destdir="${build.stripped.dir}"
152                debug="${build.debug}"
153           debuglevel="${build.debuglevel}"
154          deprecation="${build.deprecation}"
155               source="${build.sourcelevel}"
156                 fork="true">
157    
158          <bootclasspath refid="javac.bootclasspath"/>
159          <compilerarg line="${javac.args} ${build.warnings.option} -s"/>
160    
161          <!-- need this because srcdir is basedir! -->
162          <include name="java/**/*.java"/>
163    
164        </javac>
165      </target>
166    
167    
168      <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"
169              description="Puts all distributable products in single hierarchy"/>
170    
171    
172      <target name="clean"
173              description="Removes all build products">
174      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
175      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
176      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
177    </target>    </target>
178    
179    
180    <target name="clean-docs">    <target name="dist-clean"
181      <delete dir="${build.filter.src.dir}"/>            description="Removes all build and distribution products">
182      <delete dir="${build.pubdocs.dir}"/>      <delete dir="${dist.dir}"/>
     <delete dir="${build.privdocs.dir}"/>  
183    </target>    </target>
184    
185    
186    <!-- Internal targets used by docs target -->    <!-- Anthill targets -->
187    
188    <target name="compile-ant">    <!-- Should really run the tests instead of just the jar target -->
189      <target name="anthill-build" depends="jar, docs, dist-docs"
190              description="Build the jar and both the external and internal docs"/>
191    
192      <target name="anthill-publish">
193        <copy todir="${deployDir}/docs/private">
194          <fileset dir="${build.javadocs.dir}"/>
195        </copy>
196        <copy todir="${deployDir}/docs/public">
197          <fileset dir="${dist.javadocs.dir}"/>
198        </copy>
199      </target>
200    
201    
202      <!-- Internal targets -->
203    
204      <target name="set-warnings-if" if="build.warnings">
205        <property name="build.warnings.option" value="-warnunchecked"/>
206      </target>
207    
208    
209      <target name="set-warnings-unless" unless="build.warnings">
210        <property name="build.warnings.option" value=""/>
211      </target>
212    
213    
214      <target name="init" depends="set-warnings-if, set-warnings-unless">
215        <!-- Version is kept in a separate file -->
216        <loadfile property="version" srcFile="version.properties"/>
217        <echo>Building JSR-166 version ${version}</echo>
218      </target>
219    
220    
221      <target name="dist-jar" depends="clean, jar">
222        <copy file="${product.jar}" todir="${dist.dir}"/>
223      </target>
224    
225    
226      <target name="dist-docs" depends="filter-src"
227              description="Builds javadocs without custom tags to dist folder">
228        <delete dir="${dist.javadocs.dir}"/>
229        <mkdir dir="${dist.javadocs.dir}"/>
230        <javadoc destdir="${dist.javadocs.dir}"
231                    link="http://java.sun.com/j2se/1.4.1/docs/api"
232                overview="${src.dir}/intro.html"
233                  source="${build.sourcelevel}">
234    
235          <packageset dir="${build.filter.src.dir}">
236            <include name="java/**"/>
237          </packageset>
238    
239        </javadoc>
240      </target>
241    
242    
243      <target name="compile-ant-filter" depends="init">
244      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
245      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
246            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
# Line 147  Line 249 
249    </target>    </target>
250    
251    
252    <target name="filter-src" depends="compile-ant">    <target name="filter-src" depends="compile-ant-filter">
253      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
254      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
255        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
256          <include name="**/*.java"/>          <include name="java/**/*.java"/>
257        </fileset>        </fileset>
258        <filterchain>        <filterchain>
259          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
# Line 188  Line 290 
290    </target>    </target>
291    
292    
   <!-- Internal targets used by test target -->  
   
293    <target name="compile-tests" depends="jar">    <target name="compile-tests" depends="jar">
294      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
295      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
# Line 200  Line 300 
300             source="${build.sourcelevel}"             source="${build.sourcelevel}"
301               fork="true">               fork="true">
302    
303        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
304        <compilerarg line="${gj.compiler.args}"/>        <compilerarg line="${javac.args} ${build.warnings.option}"/>
305        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
306        <include name="**/*Test.java"/>        <include name="**/*Test.java"/>
307    
308      </javac>      </javac>
309    </target>    </target>
310    
311    
312    <target name="run-tests" depends="compile-tests">    <target name="run-tests" depends="compile-tests">
313      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
314      <junit printsummary="true"      <junit printsummary="true"
315               showoutput="true"               showoutput="true"
316            errorProperty="junit.failed"            errorProperty="junit.failed"
317          failureProperty="junit.failed"          failureProperty="junit.failed"
318                      dir="${build.reports.dir}">                      dir="${build.reports.dir}"
319                       fork="true">
320    
321          <jvmarg value="-Xbootclasspath/p:${product.jar}"/>
322    
323        <classpath>        <classpath>
324          <path refid="test.classpath"/>          <!-- <path refid="test.classpath"/> -->
325          <pathelement location="${build.testcases.dir}"/>          <pathelement location="${build.testcases.dir}"/>
326        </classpath>        </classpath>
327    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.16

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8