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

Diff of /jsr166/build.xml

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

revision 1.27 by tim, Wed May 28 00:33:17 2003 UTC revision 1.29 by tim, Wed May 28 14:09: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 3.8 or better 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 examples.
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 -->    <!-- User-specific settings -->
20    <property file="user.properties"/>    <property file="user.properties"/>
21    
   <!-- Set build.warnings in user.properties to turn on -warnunchecked -->  
   <!-- <property name="build.warnings" value=""/> -->  
   
22    
23    <!-- Compilation options -->    <!-- Compilation options -->
24    <property name="build.sourcelevel"    value="1.5"/>    <property name="build.sourcelevel"    value="1.5"/>
# Line 74  ant [target], where target is one of: Line 60  ant [target], where target is one of:
60    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
61    
62    
63    
64    <!--    <!--
65     ! Bootclasspath munging for source compilation.     ! Bootclasspath munging for source compilation.
66     -->     -->
67    
68    <path id="javac.bootclasspath.prepend">    <path id="javac.bootclasspath.prefix">
69      <!-- <pathelement location="${src.dir}"/> -->      <!-- <pathelement location="${src.dir}"/> -->
70      <pathelement location="${javac.jar}"/>      <pathelement location="${javac.jar}"/>
71    </path>    </path>
# Line 90  ant [target], where target is one of: Line 77  ant [target], where target is one of:
77    </path>    </path>
78    
79    <!-- Flatten bootclasspath prefix into a platform-appropriate string -->    <!-- Flatten bootclasspath prefix into a platform-appropriate string -->
80    <property name="javac.bootclasspath.prepend" refid="javac.bootclasspath.prepend"/>    <property name="javac.bootclasspath.prefix" refid="javac.bootclasspath.prefix"/>
81    
82    <!-- Turn the flattened bootclasspath prefix into a javac argument -->    <!-- Turn the flattened bootclasspath prefix into a javac argument -->
83    <property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prepend}'/>    <property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>
84    
85    
86    
87    <!--    <!--
# Line 115  ant [target], where target is one of: Line 103  ant [target], where target is one of:
103    
104    
105    
106      <!-- Files excluded from emulation and dist-docs -->
107      <patternset id="emulation.excludes">
108        <exclude name="java/util/Random.*"/>
109        <exclude name="sun/misc/Unsafe.*"/>
110      </patternset>
111    
112    
113    
114    <!-- Main targets -->    <!-- Main targets -->
115    
116    <target name="compile" depends="init"    <target name="compile"
117              depends="init"
118            description="Compiles main sources to build folder">            description="Compiles main sources to build folder">
119    
120      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
# Line 138  ant [target], where target is one of: Line 135  ant [target], where target is one of:
135    </target>    </target>
136    
137    
138    <target name="jar" depends="native-jar, emulation-jar"/>    <target name="jar"
139              depends="native-jar, emulation-jar"
140              description="Builds library jar from compiled sources"/>
141    
142    
143    <target name="test" depends="init, check-junit, report-tests"    <target name="test"
144            description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)"            depends="init, check-junit, report-tests"
145    />            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
146    
147    
148    <target name="checkstyle" depends="filter-src"    <target name="checkstyle"
149              depends="filter-src"
150            description="Reports on style errors in Java source (verbose, mostly chaff)">            description="Reports on style errors in Java source (verbose, mostly chaff)">
151    
152      <taskdef resource="checkstyletask.properties"      <taskdef resource="checkstyletask.properties"
# Line 160  ant [target], where target is one of: Line 160  ant [target], where target is one of:
160    </target>    </target>
161    
162    
163    <target name="doccheck" depends="filter-src"    <target name="doccheck"
164              depends="filter-src"
165            description="Reports on javadoc style errors (not working yet)">            description="Reports on javadoc style errors (not working yet)">
166    
167      <delete dir="${build.doccheck.dir}"/>      <delete dir="${build.doccheck.dir}"/>
# Line 175  ant [target], where target is one of: Line 176  ant [target], where target is one of:
176    </target>    </target>
177    
178    
179    <target name="docs" depends="filter-src"    <target name="docs"
180              depends="filter-src"
181            description="Builds javadocs with custom tags to build folder">            description="Builds javadocs with custom tags to build folder">
182    
183      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
# Line 187  ant [target], where target is one of: Line 189  ant [target], where target is one of:
189                source="${build.docsourcelevel}">                source="${build.docsourcelevel}">
190    
191        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
192        <tag name="spec" description="Specified by:"/>        <tag name="spec"    description="Specified by:"/>
193        <tag name="editor" description="Last edited by:"/>        <tag name="editor"  description="Last edited by:"/>
194        <tag name="fixme" description="FIX ME:"/>        <tag name="fixme"   description="FIX ME:"/>
195    
196        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
197    
198      </javadoc>      </javadoc>
# Line 202  ant [target], where target is one of: Line 205  ant [target], where target is one of:
205     # bridge methods (marked as "synthetic") that can have identical     # bridge methods (marked as "synthetic") that can have identical
206     # signatures to existing methods except for the return value.     # signatures to existing methods except for the return value.
207     -->     -->
208    <target name="strip" depends="init">    <target name="strip"
209              depends="init">
210    
211      <mkdir dir="${build.stripped.dir}"/>      <mkdir dir="${build.stripped.dir}"/>
212    
# Line 222  ant [target], where target is one of: Line 226  ant [target], where target is one of:
226    </target>    </target>
227    
228    
229    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"    <target name="dist"
230              depends="init, dist-clean, dist-jar, dist-docs"
231            description="Puts all distributable products in single hierarchy"/>            description="Puts all distributable products in single hierarchy"/>
232    
233    
# Line 244  ant [target], where target is one of: Line 249  ant [target], where target is one of:
249    </target>    </target>
250    
251    
252    <!-- Anthill targets -->    <target name="dist-docs"
253              depends="filter-src"
254              description="Builds javadocs without custom tags to dist folder">
255    
256    <!-- Should really run the tests instead of just the jar target -->      <delete dir="${dist.javadocs.dir}"/>
257    <target name="anthill-build" depends="jar, test, docs, dist-docs"/>      <mkdir dir="${dist.javadocs.dir}"/>
258    
259        <javadoc destdir="${dist.javadocs.dir}"
260                    link="http://java.sun.com/j2se/1.4.1/docs/api"
261                overview="${src.dir}/intro.html"
262                  source="${build.docsourcelevel}">
263    
264          <packageset dir="${build.filter.src.dir}"/>
265    
266        </javadoc>
267    
   <target name="anthill-publish">  
     <copy todir="${deployDir}/docs/private">  
       <fileset dir="${build.javadocs.dir}"/>  
     </copy>  
     <copy todir="${deployDir}/docs/public">  
       <fileset dir="${dist.javadocs.dir}"/>  
     </copy>  
     <copy tofile="${deployDir}/index.html"  
           file="${basedir}/etc/anthill-index.html"/>  
     <copy todir="${deployDir}/notes">  
       <fileset dir="${basedir}/etc/notes"/>  
     </copy>  
268    </target>    </target>
269    
270    
271    
272    <!-- Internal targets -->    <!-- Internal targets -->
273    
274    <target name="set-warnings-if" if="build.warnings">    <target name="set-warnings-if" if="build.warnings">
# Line 280  ant [target], where target is one of: Line 285  ant [target], where target is one of:
285    </target>    </target>
286    
287    
288    <target name="init" depends="set-warnings-if, set-warnings-unless">    <target name="init"
289              depends="set-warnings-if, set-warnings-unless">
290    
291      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
292      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
# Line 289  ant [target], where target is one of: Line 295  ant [target], where target is one of:
295    </target>    </target>
296    
297    
298    <target name="native-jar" depends="compile"    <target name="init-jar">
           description="Builds library jar from compiled sources">  
299    
300      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.lib.dir}"/>
301    
302      </target>
303    
304    
305      <target name="native-jar"
306              depends="compile, init-jar"
307              unless="build.emulation">
308    
309      <jar destfile="${product.jar}">      <jar destfile="${product.jar}">
310        <fileset dir="${build.classes.dir}"/>        <fileset dir="${build.classes.dir}"/>
311      </jar>      </jar>
# Line 301  ant [target], where target is one of: Line 313  ant [target], where target is one of:
313    </target>    </target>
314    
315    
316    <target name="compile-emulation" depends="init"    <target name="base-jar"
317            if="build.emulation"            depends="compile, init-jar">
318            description="Compiles emulation sources to build folder">  
319      </target>
320    
321    
322      <target name="compile-emulation"
323              depends="init"
324              if="build.emulation">
325    
326      <mkdir dir="${build.emulation.dir}"/>      <mkdir dir="${build.emulation.dir}"/>
327    
# Line 323  ant [target], where target is one of: Line 341  ant [target], where target is one of:
341    </target>    </target>
342    
343    
344    <target name="emulation-jar" depends="native-jar, compile-emulation"    <target name="emulation-jar"
345              depends="init-jar, compile-emulation"
346            if="build.emulation">            if="build.emulation">
347    
348      <jar destfile="${product.jar}" update="true" duplicate="add">  
349        <jar destfile="${product.jar}" duplicate="add">
350          <fileset dir="${build.classes.dir}">
351            <patternset refid="emulation.excludes"/>
352          </fileset>
353        <fileset dir="${build.emulation.dir}"/>        <fileset dir="${build.emulation.dir}"/>
354      </jar>      </jar>
355    
356    </target>    </target>
357    
358    
359    <target name="dist-jar" depends="clean, jar">    <target name="dist-jar"
360              depends="clean, jar">
361    
362      <copy file="${product.jar}" todir="${dist.dir}"/>      <copy file="${product.jar}" todir="${dist.dir}"/>
363    
364    </target>    </target>
365    
366    
367    <target name="dist-docs" depends="filter-src"    <target name="compile-ant-filter"
368            description="Builds javadocs without custom tags to dist folder">            depends="init">
   
     <delete dir="${dist.javadocs.dir}"/>  
     <mkdir dir="${dist.javadocs.dir}"/>  
   
     <javadoc destdir="${dist.javadocs.dir}"  
                 link="http://java.sun.com/j2se/1.4.1/docs/api"  
             overview="${src.dir}/intro.html"  
               source="${build.docsourcelevel}">  
   
       <packageset dir="${build.filter.src.dir}"/>  
   
     </javadoc>  
   
   </target>  
   
   
   <target name="compile-ant-filter" depends="init">  
369    
370      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
371    
# Line 370  ant [target], where target is one of: Line 377  ant [target], where target is one of:
377    </target>    </target>
378    
379    
380    <target name="filter-src" depends="compile-ant-filter">    <target name="filter-src"
381              depends="compile-ant-filter">
382    
383      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
384    
385      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
386        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
387          <include name="**/*.java"/>          <patternset refid="emulation.excludes"/>
         <exclude name="**/Random.java"/>  
         <exclude name="**/Unsafe.java"/>  
388        </fileset>        </fileset>
389        <filterchain>        <filterchain>
390          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
# Line 416  ant [target], where target is one of: Line 422  ant [target], where target is one of:
422    </target>    </target>
423    
424    
425    <target name="compile-tests" depends="jar">    <target name="compile-tests"
426              depends="jar">
427    
428      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
429    
# Line 437  ant [target], where target is one of: Line 444  ant [target], where target is one of:
444    </target>    </target>
445    
446    
447    <target name="run-tests" depends="compile-tests">    <target name="run-tests"
448              depends="compile-tests">
449    
450      <!-- May be overridden by user.properties -->      <!-- May be overridden by user.properties -->
451      <property name="testcase" value="*"/>      <property name="testcase" value="*"/>
# Line 466  ant [target], where target is one of: Line 474  ant [target], where target is one of:
474    </target>    </target>
475    
476    
477    <target name="report-tests" depends="run-tests">    <target name="report-tests"
478              depends="run-tests">
479    
480      <!-- Sets junit.report.format to frames if Xalan is present,      <!-- Sets junit.report.format to frames if Xalan is present,
481           otherwise sets it to noframes. -->           otherwise sets it to noframes. -->
482      <available property="junit.report.format"      <available property="junit.report.format"
# Line 486  ant [target], where target is one of: Line 496  ant [target], where target is one of:
496      </junitreport>      </junitreport>
497    
498      <fail message="Test Cases Failed" if="junit.failed"/>      <fail message="Test Cases Failed" if="junit.failed"/>
499    
500    </target>    </target>
501    
502    
503    <target name="check-junit">    <target name="check-junit">
504      <!-- FIXME: this test isn't specific enough -->  
505        <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
506      <available property="junit.available"      <available property="junit.available"
507                 classname="junit.framework.TestCase"/>                 classname="junit.framework.Protectable"/>
508      <fail message="Need JUnit 3.8 to run tests" unless="junit.available"/>  
509        <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
510              unless="junit.available"/>
511    
512      </target>
513    
514    
515    
516      <!-- Anthill targets -->
517    
518      <target name="anthill-build"
519              depends="jar, test, docs, dist-docs"/>
520    
521      <target name="anthill-publish">
522    
523        <copy todir="${deployDir}/docs/private">
524          <fileset dir="${build.javadocs.dir}"/>
525        </copy>
526    
527        <copy todir="${deployDir}/docs/public">
528          <fileset dir="${dist.javadocs.dir}"/>
529        </copy>
530    
531        <copy tofile="${deployDir}/index.html"
532              file="${basedir}/etc/anthill-index.html"/>
533    
534        <copy todir="${deployDir}/notes">
535          <fileset dir="${basedir}/etc/notes"/>
536        </copy>
537    
538    </target>    </target>
539    
540    

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.29

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