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

Diff of /jsr166/build.xml

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

revision 1.28 by tim, Wed May 28 13:37:59 2003 UTC revision 1.33 by tim, Thu May 29 12:54:10 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 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 -->    <!-- 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 68  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    
60    
61    
   <!--  
    ! Bootclasspath munging for source compilation.  
    -->  
   
   <path id="javac.bootclasspath.prefix">  
     <!-- <pathelement location="${src.dir}"/> -->  
     <pathelement location="${javac.jar}"/>  
   </path>  
   
   <path id="javac.bootclasspath">  
     <!-- <pathelement location="${src.dir}"/> -->  
     <pathelement location="${collect.jar}"/>  
     <pathelement location="${rt.jar}"/>  
   </path>  
   
   <!-- Flatten bootclasspath prefix into a platform-appropriate string -->  
   <property name="javac.bootclasspath.prefix" refid="javac.bootclasspath.prefix"/>  
   
   <!-- Turn the flattened bootclasspath prefix into a javac argument -->  
   <property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>  
   
   
   
   <!--  
    ! Bootclasspath munging for testing, so JUnit can test our local  
    ! modifications to java.*.  
    -->  
   
   <path id="test.classpath">  
     <pathelement location="${product.jar}"/>  
     <pathelement location="${build.testcases.dir}"/>  
     <pathelement location="${junit.jar}"/>  
   </path>  
   
   <!-- Flatten test classpath into a platform-appropriate string -->  
   <property name="test.classpath" refid="test.classpath"/>  
   
   <!-- Turn the flattened test classpath into a javac argument -->  
   <property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/>  
   
   
   
62    <!-- Files excluded from emulation and dist-docs -->    <!-- Files excluded from emulation and dist-docs -->
63    <patternset id="emulation.excludes">    <patternset id="emulation.excludes">
64      <exclude name="java/util/Random.*"/>      <exclude name="java/util/Random.*"/>
# Line 128  ant [target], where target is one of: Line 70  ant [target], where target is one of:
70    <!-- Main targets -->    <!-- Main targets -->
71    
72    <target name="compile"    <target name="compile"
73            depends="init"            depends="init, configure-compiler, prepare-src"
74            description="Compiles main sources to build folder">            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    
80      <javac srcdir="${src.dir}"      <javac srcdir="${prepare.src.dir}"
81            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
82              debug="${build.debug}"              debug="${build.debug}"
83         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 142  ant [target], where target is one of: Line 86  ant [target], where target is one of:
86               fork="true">               fork="true">
87    
88        <bootclasspath refid="javac.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
89        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <compilerarg line="${build.javac.args}"/>
90    
91      </javac>      </javac>
92    
# Line 150  ant [target], where target is one of: Line 94  ant [target], where target is one of:
94    
95    
96    <target name="jar"    <target name="jar"
97            depends="native-jar, emulation-jar"            depends="configure-emulation, init-jar, native-jar, emulation-jar"
98            description="Builds library jar from compiled sources"/>            description="Builds library jar from compiled sources"/>
99    
100    
101    <target name="test"    <target name="test"
102            depends="init, check-junit, report-tests"            depends="init, configure-tests, report-tests"
103            description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)" />            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
104    
105    
106    <target name="checkstyle"    <target name="checkstyle"
# Line 203  ant [target], where target is one of: Line 147  ant [target], where target is one of:
147                source="${build.docsourcelevel}">                source="${build.docsourcelevel}">
148    
149        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
150        <tag name="spec" description="Specified by:"/>        <tag name="spec"    description="Specified by:"/>
151        <tag name="editor" description="Last edited by:"/>        <tag name="editor"  description="Last edited by:"/>
152        <tag name="fixme" description="FIX ME:"/>        <tag name="fixme"   description="FIX ME:"/>
153    
154        <packageset dir="${build.filter.src.dir}"/>        <packageset dir="${build.filter.src.dir}"/>
155    
156      </javadoc>      </javadoc>
# Line 213  ant [target], where target is one of: Line 158  ant [target], where target is one of:
158    </target>    </target>
159    
160    
   <!--  
    # javac -s doesn't reliably generate compilable code. It generates  
    # bridge methods (marked as "synthetic") that can have identical  
    # signatures to existing methods except for the return value.  
    -->  
161    <target name="strip"    <target name="strip"
162            depends="init">            depends="init, configure-compiler"
163              description="Strip generics from java source (not working yet)">
164    
165      <mkdir dir="${build.stripped.dir}"/>      <mkdir dir="${build.stripped.dir}"/>
166    
167        <!--
168         # javac -s doesn't reliably generate compilable code. It generates
169         # bridge methods (marked as "synthetic") that can have identical
170         # signatures to existing methods except for the return value.
171         -->
172      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
173            destdir="${build.stripped.dir}"            destdir="${build.stripped.dir}"
174              debug="${build.debug}"              debug="${build.debug}"
# Line 232  ant [target], where target is one of: Line 178  ant [target], where target is one of:
178               fork="true">               fork="true">
179    
180        <bootclasspath refid="javac.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
181        <compilerarg line="${javac.args} ${build.warnings.option} -s"/>        <compilerarg line="${build.javac.args} -s"/>
182    
183      </javac>      </javac>
184    
# Line 284  ant [target], where target is one of: Line 230  ant [target], where target is one of:
230    
231    <!-- Internal targets -->    <!-- Internal targets -->
232    
   <target name="set-warnings-if" if="build.warnings">  
   
     <property name="build.warnings.option" value="-warnunchecked"/>  
   
   </target>  
   
   
   <target name="set-warnings-unless" unless="build.warnings">  
   
     <property name="build.warnings.option" value=""/>  
   
   </target>  
233    
234      <target name="init">
   <target name="init"  
           depends="set-warnings-if, set-warnings-unless">  
235    
236      <!-- Version is kept in a separate file -->      <!-- Version is kept in a separate file -->
237      <loadfile property="version" srcFile="version.properties"/>      <loadfile property="version" srcFile="version.properties"/>
# Line 316  ant [target], where target is one of: Line 248  ant [target], where target is one of:
248    
249    
250    <target name="native-jar"    <target name="native-jar"
251            depends="compile, init-jar"            depends="compile"
252            unless="build.emulation">            unless="build.emulation.true">
253    
254      <jar destfile="${product.jar}">      <jar destfile="${product.jar}">
255        <fileset dir="${build.classes.dir}"/>        <fileset dir="${build.classes.dir}"/>
# Line 326  ant [target], where target is one of: Line 258  ant [target], where target is one of:
258    </target>    </target>
259    
260    
   <target name="base-jar"  
           depends="compile, init-jar">  
   
     <jar destfile="${product.jar}">  
       <fileset dir="${build.classes.dir}">  
         <patternset refid="emulation.excludes"/>  
       </fileset>  
     </jar>  
   
   </target>  
   
   
261    <target name="compile-emulation"    <target name="compile-emulation"
262            depends="init"            depends="init, configure-compiler"
263            if="build.emulation">            if="build.emulation.true">
264    
265      <mkdir dir="${build.emulation.dir}"/>      <mkdir dir="${build.emulation.dir}"/>
266    
# Line 353  ant [target], where target is one of: Line 273  ant [target], where target is one of:
273               fork="true">               fork="true">
274    
275        <bootclasspath refid="javac.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
276        <compilerarg line="${javac.args} ${build.warnings.option}"/>        <compilerarg line="${build.javac.args}"/>
277    
278      </javac>      </javac>
279    
# Line 361  ant [target], where target is one of: Line 281  ant [target], where target is one of:
281    
282    
283    <target name="emulation-jar"    <target name="emulation-jar"
284            depends="base-jar, compile-emulation"            depends="compile-emulation"
285            if="build.emulation">            if="build.emulation.true">
286    
287    
288      <jar destfile="${product.jar}" update="true" duplicate="add">      <jar destfile="${product.jar}" duplicate="add">
289          <fileset dir="${build.classes.dir}">
290            <patternset refid="emulation.excludes"/>
291          </fileset>
292        <fileset dir="${build.emulation.dir}"/>        <fileset dir="${build.emulation.dir}"/>
293      </jar>      </jar>
294    
# Line 399  ant [target], where target is one of: Line 323  ant [target], where target is one of:
323    
324      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
325        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
326            <include name="**/*.html"/>
327          </fileset>
328        </copy>
329    
330        <copy todir="${build.filter.src.dir}">
331          <fileset dir="${src.dir}">
332            <exclude name="**/*.html"/>
333          <patternset refid="emulation.excludes"/>          <patternset refid="emulation.excludes"/>
334        </fileset>        </fileset>
335        <filterchain>        <filterchain>
# Line 450  ant [target], where target is one of: Line 381  ant [target], where target is one of:
381             source="${build.sourcelevel}"             source="${build.sourcelevel}"
382               fork="true">               fork="true">
383    
       <bootclasspath refid="javac.bootclasspath"/>  
       <compilerarg line="${javac.args} ${build.warnings.option}"/>  
384        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
385          <bootclasspath refid="javac.bootclasspath"/>
386          <compilerarg line="${build.javac.args}"/>
387    
388      </javac>      </javac>
389    
# Line 474  ant [target], where target is one of: Line 405  ant [target], where target is one of:
405                      dir="${build.reports.dir}"                      dir="${build.reports.dir}"
406                     fork="true">                     fork="true">
407    
408        <jvmarg value="${test.javac.args}"/>        <jvmarg value="${test.bootclasspath.arg}"/>
409    
410        <formatter type="xml"/>        <formatter type="xml"/>
411    
# Line 515  ant [target], where target is one of: Line 446  ant [target], where target is one of:
446    </target>    </target>
447    
448    
449    <target name="check-junit">    <target name="configure-compiler">
450    
451        <property name="gjc.version"
452                 value="1.3"/>
453    
454        <condition property="build.novariance" value="-novariance">
455          <and>
456            <equals arg1="${gjc.version}" arg2="2.0"/>
457            <or>
458              <not><isset property="gjc.novariance"/></not>
459              <istrue value="${gjc.novariance}"/>
460            </or>
461          </and>
462        </condition>
463    
464        <property name="build.novariance"
465                 value=""/>
466    
467        <property name="gjc.dir"
468                 value="${lib.dir}/gjc"/>
469    
470        <property name="javac.jar"
471              location="${gjc.dir}/${gjc.version}/javac.jar"/>
472    
473        <property name="collect.jar"
474              location="${gjc.dir}/${gjc.version}/collect${build.novariance}.jar"/>
475    
476    
477        <condition property="build.warnunchecked" value="-warnunchecked">
478          <istrue value="${gjc.warnunchecked}"/>
479        </condition>
480    
481        <property name="build.warnunchecked" value=""/>
482    
483    
484        <!--
485         ! Bootclasspath munging for source compilation.
486         -->
487    
488        <path id="javac.bootclasspath.prefix">
489          <!-- <pathelement location="${src.dir}"/> -->
490          <pathelement location="${javac.jar}"/>
491        </path>
492    
493        <path id="javac.bootclasspath">
494          <!-- <pathelement location="${src.dir}"/> -->
495          <pathelement location="${collect.jar}"/>
496          <pathelement location="${rt.jar}"/>
497        </path>
498    
499        <!-- Flatten bootclasspath prefix into a platform-appropriate string -->
500        <property name="javac.bootclasspath.prefix"
501                 refid="javac.bootclasspath.prefix"/>
502    
503        <!-- Turn the flattened bootclasspath prefix into a javac argument -->
504        <property name="build.bootclasspath.arg"
505                 value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/>
506    
507        <!-- Flatten bootclasspath for trace message -->
508        <property name="javac.bootclasspath"
509                 refid="javac.bootclasspath"/>
510    
511        <!-- Common options in javac invocations -->
512        <property name="build.javac.args"
513                 value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/>
514    
515        <echo>javac ${build.javac.args}</echo>
516        <echo>bootclasspath=${javac.bootclasspath}</echo>
517    
518      </target>
519    
520    
521      <target name="configure-src">
522    
523        <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
524          <istrue value="${build.nothreads}"/>
525        </condition>
526    
527      </target>
528    
529      <target name="prepare-src"
530              depends="configure-src"
531              if="prepare.src.dir">
532    
533        <mkdir dir="${prepare.src.dir}"/>
534        <copy todir="${prepare.src.dir}">
535          <fileset dir="${src.dir}">
536            <exclude name="java/lang/**"/>
537          </fileset>
538        </copy>
539    
540      </target>
541    
542    
543      <target name="configure-emulation">
544    
545        <condition property="build.emulation.true">
546          <or>
547            <and>
548              <os family="windows"/>
549              <not>
550                <isset property="build.emulation"/>
551              </not>
552            </and>
553            <istrue value="${build.emulation}"/>
554          </or>
555        </condition>
556    
557      </target>
558    
559    
560      <target name="configure-tests">
561    
562      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->      <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
563      <available property="junit.available"      <available property="junit.available"
# Line 524  ant [target], where target is one of: Line 566  ant [target], where target is one of:
566      <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"      <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
567            unless="junit.available"/>            unless="junit.available"/>
568    
569    
570        <!--
571         ! Bootclasspath munging for testing, so JUnit can test our local
572         ! modifications to java.*.
573         -->
574    
575        <path id="test.classpath">
576          <pathelement location="${product.jar}"/>
577          <pathelement location="${build.testcases.dir}"/>
578          <pathelement location="${junit.jar}"/>
579        </path>
580    
581        <!-- Flatten test classpath into a platform-appropriate string -->
582        <property name="test.classpath" refid="test.classpath"/>
583    
584        <!-- Turn the flattened test classpath into a javac argument -->
585        <property name="test.bootclasspath.arg"
586                 value='-Xbootclasspath/p:${test.classpath}'/>
587    
588    </target>    </target>
589    
590    

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.33

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