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

Diff of /jsr166/build.xml

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

revision 1.23 by tim, Sat May 17 21:20:50 2003 UTC revision 1.39 by tim, Sat May 31 17:24:03 2003 UTC
# Line 1  Line 1 
1  <project name="jsr166" default="usage">  <project name="jsr166" default="usage">
2    
3    <description>    <description>
4      Build file for JSR-166  ------------------------------------------------------------------------------
5      Build file for JSR-166
6    
7      JUnit 1.8 must be in ${ant.home}/lib for the test target to work.    Usage: ant [target]
   </description>  
8    
9      User-specific settings are read from user.properties.
10      See user.properties.sample for an explanation of some useful settings.
11    ------------------------------------------------------------------------------
12      </description>
13    
14    <target name="usage" description="Prints this message">    <target name="usage" description="Advises user to run with -projecthelp">
15      <echo>      <echo>Run "ant -projecthelp" for full usage information.</echo>
 ant [target], where target is one of:  
   
  usage       (default) Prints this message  
  compile     Compiles all sources to build folder  
  jar         Builds library jar from compiled sources  
  test        Runs all tests (requires JUnit 1.8 in ${ant.home}/lib)  
  docs        Builds javadocs with custom tags to build folder  
  dist-docs   Builds javadocs without custom tags to dist folder  
  dist        Puts all distributable products in single hierarchy  
   
  clean       Removes all build products  
  dist-clean  Removes all build and distribution products  
   
  checkstyle  Reports on style errors in Java source (verbose, mostly chaff)  
  doccheck    Reports on javadoc style errors (not working yet)  
     </echo>  
16    </target>    </target>
17    
18    
19      <!-- User-specific settings -->
20    <property file="user.properties"/>    <property file="user.properties"/>
21    <property name="testcase" value="*"/>  
22    
23    <!-- Compilation options -->    <!-- Compilation options -->
24    <property name="build.sourcelevel"    value="1.5"/>    <property name="build.sourcelevel"    value="1.5"/>
25      <property name="build.docsourcelevel" value="1.4"/>
26    <property name="build.debug"          value="true"/>    <property name="build.debug"          value="true"/>
27    <property name="build.debuglevel"     value="source,lines,vars"/>    <property name="build.debuglevel"     value="source,lines,vars"/>
28    <property name="build.deprecation"    value="false"/>    <property name="build.deprecation"    value="false"/>
   <!--  
   <property name="build.warnings"       value="true"/>  
   -->  
29    
30    <!-- Build locations -->    <!-- Build locations -->
31    <property name="build.dir"            location="build"/>    <property name="build.dir"            location="build"/>
32    <property name="build.classes.dir"    location="${build.dir}/classes"/>    <property name="build.classes.dir"    location="${build.dir}/classes"/>
33      <property name="build.emulation.dir"  location="${build.dir}/emulation"/>
34    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
35    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
36    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <property name="build.ant.dir"        location="${build.dir}/ant"/>
# Line 53  ant [target], where target is one of: Line 42  ant [target], where target is one of:
42    
43    <!-- Source locations -->    <!-- Source locations -->
44    <property name="src.dir"              location="${basedir}/src/main"/>    <property name="src.dir"              location="${basedir}/src/main"/>
45      <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
46    <property name="test.src.dir"         location="${basedir}/src/test"/>    <property name="test.src.dir"         location="${basedir}/src/test"/>
47    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
48    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
# Line 64  ant [target], where target is one of: Line 54  ant [target], where target is one of:
54    
55    <!-- Jar locations -->    <!-- Jar locations -->
56    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
   <property name="javac.jar"            location="${lib.dir}/javac.jar"/>  
   <property name="collect.jar"          location="${lib.dir}/collect.jar"/>  
57    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
58    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
59    
   <property name="javac.args"           value='-J-Xbootclasspath/p:${javac.jar}'/>  
60    
61    <path id="javac.bootclasspath">  
62      <pathelement location="${collect.jar}"/>    <!-- Files excluded from emulation and dist-docs -->
63      <pathelement location="${rt.jar}"/>    <patternset id="emulation.excludes">
64    </path>      <exclude name="java/util/Random.*"/>
65        <exclude name="sun/misc/Unsafe.*"/>
66    <path id="test.classpath">    </patternset>
67      <pathelement location="${product.jar}"/>  
   </path>  
68    
69    
70    <!-- Main targets -->    <!-- Main targets -->
71    
72    <target name="compile" depends="init"    <target name="compile"
73            description="Compiles all sources to build folder">            depends="init, configure-compiler, prepare-src"
74              description="Compiles main sources to build folder">
75    
76        <property name="prepare.src.dir" value="${src.dir}"/>
77    
78      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
79      <javac srcdir="${src.dir}"  
80    <!--
81        <echo>javac ${gjc.args}</echo>
82        <echo>bootclasspath=${compile.bootclasspath}</echo>
83    -->
84    
85        <javac srcdir="${prepare.src.dir}"
86            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
87              debug="${build.debug}"              debug="${build.debug}"
88         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 94  ant [target], where target is one of: Line 90  ant [target], where target is one of:
90             source="${build.sourcelevel}"             source="${build.sourcelevel}"
91               fork="true">               fork="true">
92    
93        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
94        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <bootclasspath refid="compile.bootclasspath"/>
95    
96      </javac>      </javac>
97    
98    </target>    </target>
99    
100    
101    <target name="jar" depends="compile"    <target name="jar"
102            description="Builds library jar from compiled sources">            depends="configure-emulation, init-jar, native-jar, emulation-jar"
103      <mkdir dir="${build.lib.dir}"/>            description="Builds library jar from compiled sources"/>
     <jar basedir="${build.classes.dir}"  
         destfile="${product.jar}"  
     />  
   </target>  
104    
105    
106    <target name="test" depends="init, check-junit, report-tests"    <target name="test"
107            description="Runs all tests (requires JUnit 1.8 in ${ant.home}/lib)"/>            depends="init, configure-tests, report-tests"
108              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
109    
110    
111    <target name="checkstyle" depends="filter-src"    <target name="checkstyle"
112              depends="filter-src"
113            description="Reports on style errors in Java source (verbose, mostly chaff)">            description="Reports on style errors in Java source (verbose, mostly chaff)">
114    
115      <taskdef resource="checkstyletask.properties"      <taskdef resource="checkstyletask.properties"
116              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>              classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
117    
# Line 123  ant [target], where target is one of: Line 119  ant [target], where target is one of:
119        <formatter type="plain"/>  <!-- also available: type="xml" -->        <formatter type="plain"/>  <!-- also available: type="xml" -->
120        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>        <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
121      </checkstyle>      </checkstyle>
122    
123    </target>    </target>
124    
125    
126    <target name="doccheck" depends="filter-src"    <target name="doccheck"
127              depends="filter-src"
128            description="Reports on javadoc style errors (not working yet)">            description="Reports on javadoc style errors (not working yet)">
129    
130      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
131      <mkdir dir="${build.doccheck.dir}"/>      <mkdir dir="${build.doccheck.dir}"/>
132    
133      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"      <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
134           docletpath="${lib.dir}/doccheck.jar"           docletpath="${lib.dir}/doccheck.jar"
135              destdir="${build.doccheck.dir}">              destdir="${build.doccheck.dir}">
136        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
137      </javadoc>      </javadoc>
138    
139    </target>    </target>
140    
141    
142    <target name="docs" depends="filter-src"    <target name="docs"
143              depends="filter-src"
144            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
145    
146      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
147      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
148    
149      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
150                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://java.sun.com/j2se/1.4.1/docs/api"
151              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
152                source="${build.sourcelevel}">                source="${build.docsourcelevel}">
153    
154        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
155        <tag name="spec" description="Specified by:"/>        <tag name="spec"    description="Specified by:"/>
156        <tag name="editor" description="Last edited by:"/>        <tag name="editor"  description="Last edited by:"/>
157        <tag name="fixme" description="FIX ME:"/>        <tag name="fixme"   description="FIX ME:"/>
158    
159        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
160    
161      </javadoc>      </javadoc>
162    
163    </target>    </target>
164    
165    
166    <!--    <target name="strip"
167     # javac -s doesn't reliably generate compilable code. It generates            depends="init, configure-compiler"
168     # bridge methods (marked as "synthetic") that can have identical            description="Strip generics from java source (not working yet)">
169     # signatures to existing methods except for the return value.  
    -->  
   <target name="strip" depends="init">  
170      <mkdir dir="${build.stripped.dir}"/>      <mkdir dir="${build.stripped.dir}"/>
171    
172        <!--
173         # javac -s doesn't reliably generate compilable code. It generates
174         # bridge methods (marked as "synthetic") that can have identical
175         # signatures to existing methods except for the return value.
176         -->
177      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
178            destdir="${build.stripped.dir}"            destdir="${build.stripped.dir}"
179              debug="${build.debug}"              debug="${build.debug}"
# Line 172  ant [target], where target is one of: Line 182  ant [target], where target is one of:
182             source="${build.sourcelevel}"             source="${build.sourcelevel}"
183               fork="true">               fork="true">
184    
185        <bootclasspath refid="javac.bootclasspath"/>        <compilerarg    line="${gjc.args} -s"/>
186        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>        <bootclasspath refid="compile.bootclasspath"/>
187    
188      </javac>      </javac>
189    
190    </target>    </target>
191    
192    
193    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"    <target name="dist"
194              depends="init, dist-clean, dist-jar, dist-docs"
195            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
196    
197    
198    <target name="clean"    <target name="clean"
199            description="Removes all build products">            description="Removes all build products">
200    
201      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
202      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
203      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
204    
205    </target>    </target>
206    
207    
208    <target name="dist-clean"    <target name="dist-clean"
209            description="Removes all build and distribution products">            description="Removes all build and distribution products">
210    
211      <delete dir="${dist.dir}"/>      <delete dir="${dist.dir}"/>
212    
213    </target>    </target>
214    
215    
216    <!-- Anthill targets -->    <target name="dist-docs"
217              depends="filter-src"
218              description="Builds javadocs without custom tags to dist folder">
219    
220    <!-- Should really run the tests instead of just the jar target -->      <delete dir="${dist.javadocs.dir}"/>
221    <target name="a