[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.9, Wed Dec 11 05:04:04 2002 UTC revision 1.14, 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      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 43  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}'/>
            value='-J-Xbootclasspath/p:${javac.jar} -deprecation -warnunchecked'  
   />  
52    
53    <path id="gj.compiler.bootclasspath">    <path id="javac.bootclasspath">
54      <pathelement location="${collect.jar}"/>      <pathelement location="${collect.jar}"/>
55      <pathelement location="${rt.jar}"/>      <pathelement location="${rt.jar}"/>
56    </path>    </path>
# Line 57  Line 60 
60    </path>    </path>
61    
62    
63    <target name="compile">    <!-- Main targets -->
64    
65      <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 67  Line 73 
73             source="${build.sourcelevel}"             source="${build.sourcelevel}"
74               fork="true">               fork="true">
75    
76        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
77        <compilerarg line="${gj.compiler.args}"/>        <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 77  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 85  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="clean-filtered-src, filter-src"    <target name="docs" depends="init, clean-filtered-src, filter-src"
100            description="Builds javadocs with custom tags to build folder">            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}"/>
# Line 109  Line 117 
117    </target>    </target>
118    
119    
120    <target name="dist-docs" depends="clean-filtered-src, filter-src"    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/>
           description="Builds javadocs without custom tags to dist folder">  
     <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.sourcelevel}">  
121    
       <packageset dir="${build.filter.src.dir}">  
         <include name="java/**"/>  
       </packageset>  
122    
123      </javadoc>    <target name="clean"
124              description="Removes all build products">
125        <delete dir="${build.dir}"/>
126        <delete dir="${build.classes.dir}"/>
127        <delete dir="${build.lib.dir}"/>
128    </target>    </target>
129    
130    
131    <target name="dist" depends="clean, jar, dist-docs">    <target name="dist-clean"
132      <!-- nothing to do here yet -->            description="Removes all build and distribution products">
133        <delete dir="${dist.dir}"/>
134    </target>    </target>
135    
136    
137    <target name="clean">    <!-- Anthill targets -->
138      <delete dir="${build.dir}"/>  
139      <delete dir="${build.classes.dir}"/>    <!-- Should really run the tests instead of just the jar target -->
140      <delete dir="${build.lib.dir}"/>    <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>    </target>
151    
152    
153    <target name="dist-clean" depends="clean">    <!-- Internal targets -->
154      <delete dir="${dist.dir}"/>  
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>    </target>
168    
169    
# Line 148  Line 172 
172    </target>    </target>
173    
174    
175    <!-- Internal targets used by docs target -->    <target name="dist-jar" depends="clean, jar">
176        <copy file="${product.jar}" todir="${dist.dir}"/>
177      </target>
178    
179    
180    <target name="compile-ant">    <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 159  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 200  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 212  Line 254 
254             source="${build.sourcelevel}"             source="${build.sourcelevel}"
255               fork="true">               fork="true">
256    
257        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
258        <compilerarg line="${gj.compiler.args}"/>        <compilerarg line="${javac.args} ${build.warnings.option}"/>
259        <classpath refid="test.classpath"/>        <classpath refid="test.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.9  
changed lines
  Added in v.1.14

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8