[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.4, Wed Dec 4 04:30:54 2002 UTC revision 1.15, Thu Dec 12 23:50:31 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.4"/>    <!--
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 31  Line 36 
36    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
37    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
38    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
39      <property name="dist.dir"             location="${basedir}/dist"/>
40    
41      <!-- Distribution locations -->
42      <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
43    
44    <!-- Jar locations -->    <!-- Jar locations -->
45    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
# Line 39  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} -gj'  
   />  
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 53  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 63  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 73  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 81  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="filter-src">    <target name="checkstyle" depends="init, clean-filtered-src, filter-src">
100        <taskdef resource="checkstyletask.properties"
101                classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
102    
103        <checkstyle>
104          <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
105        </checkstyle>
106      </target>
107    
108      <target name="docs" depends="init, clean-filtered-src, filter-src"
109              description="Builds javadocs with custom tags to build folder">
110      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
111      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
112      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
# Line 104  Line 126 
126    </target>    </target>
127    
128    
129    <target name="clean">    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/>
130    
131    
132      <target name="clean"
133              description="Removes all build products">
134      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
135      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
136      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
     <delete dir="${build.javadocs.dir}"/>  
137    </target>    </target>
138    
139    
140    <!-- Internal targets used by docs target -->    <target name="dist-clean"
141              description="Removes all build and distribution products">
142        <delete dir="${dist.dir}"/>
143      </target>
144    
145    
146      <!-- Anthill targets -->
147    
148      <!-- Should really run the tests instead of just the jar target -->
149      <target name="anthill-build" depends="jar, docs, dist-docs"
150              description="Build the jar and both the external and internal docs"/>
151    
152      <target name="anthill-publish">
153        <copy todir="${deployDir}/docs/private">
154          <fileset dir="${build.javadocs.dir}"/>
155        </copy>
156        <copy todir="${deployDir}/docs/public">
157          <fileset dir="${dist.javadocs.dir}"/>
158        </copy>
159      </target>
160    
161    
162      <!-- Internal targets -->
163    
164      <target name="set-warnings-if" if="build.warnings">
165        <property name="build.warnings.option" value="-warnunchecked"/>
166      </target>
167    
168      <target name="set-warnings-unless" unless="build.warnings">
169        <property name="build.warnings.option" value=""/>
170      </target>
171    
172      <target name="init" depends="set-warnings-if, set-warnings-unless">
173        <!-- Version is kept in a separate file -->
174        <loadfile property="version" srcFile="version.properties"/>
175        <echo>Building JSR-166 version ${version}</echo>
176      </target>
177    
178    
179      <target name="clean-filtered-src">
180        <delete dir="${build.filter.src.dir}"/>
181      </target>
182    
183    
184      <target name="dist-jar" depends="clean, jar">
185        <copy file="${product.jar}" todir="${dist.dir}"/>
186      </target>
187    
188    
189      <target name="dist-docs" depends="clean-filtered-src, filter-src"
190              description="Builds javadocs without custom tags to dist folder">
191        <delete dir="${dist.javadocs.dir}"/>
192        <mkdir dir="${dist.javadocs.dir}"/>
193        <javadoc destdir="${dist.javadocs.dir}"
194                    link="http://java.sun.com/j2se/1.4.1/docs/api"
195                overview="${src.dir}/intro.html"
196                  source="${build.sourcelevel}">
197    
198          <packageset dir="${build.filter.src.dir}">
199            <include name="java/**"/>
200          </packageset>
201    
202        </javadoc>
203      </target>
204    
205    <target name="compile-ant">  
206      <target name="compile-ant-filter">
207      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
208      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
209            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
# Line 123  Line 212 
212    </target>    </target>
213    
214    
215    <target name="filter-src" depends="compile-ant">    <target name="filter-src" depends="compile-ant-filter">
216      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
217      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
218        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
219          <include name="**/*.java"/>          <include name="java/**/*.java"/>
220        </fileset>        </fileset>
221        <filterchain>        <filterchain>
222          <filterreader classname="jsr166.ant.filters.ReplaceFilter"          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
# Line 164  Line 253 
253    </target>    </target>
254    
255    
   <!-- Internal targets used by test target -->  
   
256    <target name="compile-tests" depends="jar">    <target name="compile-tests" depends="jar">
257      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
258      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
# Line 176  Line 263 
263             source="${build.sourcelevel}"             source="${build.sourcelevel}"
264               fork="true">               fork="true">
265    
266        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
267        <compilerarg line="${gj.compiler.args}"/>        <compilerarg line="${javac.args} ${build.warnings.option}"/>
268        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
269        <include name="**/*Test.java"/>        <include name="**/*Test.java"/>
270    
271      </javac>      </javac>
272    </target>    </target>
273    
274    
275    <target name="run-tests" depends="compile-tests">    <target name="run-tests" depends="compile-tests">
276      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
277      <junit printsummary="true"      <junit printsummary="true"
278               showoutput="true"               showoutput="true"
279            errorProperty="junit.failed"            errorProperty="junit.failed"
280          failureProperty="junit.failed"          failureProperty="junit.failed"
281                      dir="${build.reports.dir}">                      dir="${build.reports.dir}"
282                       fork="true">
283    
284          <jvmarg value="-Xbootclasspath/p:${product.jar}"/>
285    
286        <classpath>        <classpath>
287          <path refid="test.classpath"/>          <!-- <path refid="test.classpath"/> -->
288          <pathelement location="${build.testcases.dir}"/>          <pathelement location="${build.testcases.dir}"/>
289        </classpath>        </classpath>
290    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.15

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8