ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
Revision: 1.6
Committed: Tue Dec 10 15:02:46 2002 UTC (21 years, 4 months ago) by tim
Content type: text/xml
Branch: MAIN
Changes since 1.5: +7 -3 lines
Log Message:
Turn on -deprecation and -warnunchecked for compilation.
Always clean docs before building.
Fix a bunch of unchecked assignments.

File Contents

# User Rev Content
1 tim 1.1 <project name="jsr166" default="jar">
2    
3     <description>
4     Build file for JSR-166
5 tim 1.3
6     Note that junit.jar must be in ${ant.home}/lib for the
7     test target to work. [FIXME: This should be automatically
8     enforced by this build file by failing with a message if
9     junit.jar is not in the right place.]
10 tim 1.1 </description>
11    
12     <!-- Compilation options -->
13     <property name="build.debug" value="true"/>
14     <property name="build.debuglevel" value="source,lines,vars"/>
15     <property name="build.deprecation" value="false"/>
16 tim 1.5 <property name="build.sourcelevel" value="1.5"/>
17 tim 1.1
18     <!-- Build locations -->
19     <property name="build.dir" location="build"/>
20     <property name="build.classes.dir" location="${build.dir}/classes"/>
21     <property name="build.testcases.dir" location="${build.dir}/testcases"/>
22     <property name="build.lib.dir" location="${build.dir}/lib"/>
23     <property name="build.ant.dir" location="${build.dir}/ant"/>
24     <property name="build.javadocs.dir" location="${build.dir}/javadocs"/>
25     <property name="build.reports.dir" location="${build.dir}/reports"/>
26     <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
27    
28     <!-- Source locations -->
29     <property name="src.dir" location="${basedir}"/>
30     <property name="test.src.dir" location="${basedir}/etc/testcases"/>
31     <property name="ant.src.dir" location="${basedir}/etc/ant"/>
32     <property name="stylesheet.dir" location="${basedir}/etc/xsl"/>
33     <property name="lib.dir" location="${basedir}/lib"/>
34    
35     <!-- Jar locations -->
36     <property name="product.jar" location="${build.lib.dir}/jsr166.jar"/>
37     <property name="javac.jar" location="${lib.dir}/javac.jar"/>
38     <property name="collect.jar" location="${lib.dir}/collect.jar"/>
39     <property name="junit.jar" location="${lib.dir}/junit.jar"/>
40     <property name="rt.jar" location="${java.home}/lib/rt.jar"/>
41    
42     <property name="gj.compiler.args"
43 tim 1.6 value='-J-Xbootclasspath/p:${javac.jar} -deprecation -warnunchecked'
44 tim 1.1 />
45    
46 tim 1.2 <path id="gj.compiler.bootclasspath">
47     <pathelement location="${collect.jar}"/>
48     <pathelement location="${rt.jar}"/>
49     </path>
50    
51     <path id="test.classpath">
52     <pathelement location="${product.jar}"/>
53     </path>
54    
55 tim 1.1
56     <target name="compile">
57     <mkdir dir="${build.classes.dir}"/>
58     <javac srcdir="${src.dir}"
59     destdir="${build.classes.dir}"
60     debug="${build.debug}"
61     debuglevel="${build.debuglevel}"
62     deprecation="${build.deprecation}"
63     source="${build.sourcelevel}"
64     fork="true">
65    
66 tim 1.2 <bootclasspath refid="gj.compiler.bootclasspath"/>
67 tim 1.1 <compilerarg line="${gj.compiler.args}"/>
68    
69     <!-- need this because srcdir is basedir! -->
70     <include name="java/**/*.java"/>
71    
72     </javac>
73     </target>
74    
75    
76     <target name="jar" depends="compile">
77     <mkdir dir="${build.lib.dir}"/>
78     <jar basedir="${build.classes.dir}"
79     destfile="${product.jar}"
80     />
81     </target>
82    
83    
84     <target name="test" depends="report-tests"/>
85    
86    
87 tim 1.6 <target name="docs" depends="clean-docs, filter-src">
88 tim 1.1 <delete dir="${build.javadocs.dir}"/>
89     <mkdir dir="${build.javadocs.dir}"/>
90     <javadoc destdir="${build.javadocs.dir}"
91     link="http://java.sun.com/j2se/1.4.1/docs/api"
92     overview="${src.dir}/intro.html"
93     source="${build.sourcelevel}">
94    
95     <tag name="revised" description="Last revised:"/>
96     <tag name="spec" description="Specified by:"/>
97 dholmes 1.4 <tag name="editor" description="Last edited by:"/>
98     <tag name="fixme" description="FIX ME:"/>
99 tim 1.1 <packageset dir="${build.filter.src.dir}">
100     <include name="java/**"/>
101     </packageset>
102    
103     </javadoc>
104     </target>
105    
106    
107 tim 1.6 <target name="clean" depends="clean-docs">
108 tim 1.1 <delete dir="${build.dir}"/>
109     <delete dir="${build.classes.dir}"/>
110     <delete dir="${build.lib.dir}"/>
111 tim 1.6 </target>
112    
113    
114     <target name="clean-docs">
115 tim 1.1 <delete dir="${build.javadocs.dir}"/>
116     </target>
117    
118    
119     <!-- Internal targets used by docs target -->
120    
121     <target name="compile-ant">
122     <mkdir dir="${build.ant.dir}"/>
123     <javac srcdir="${ant.src.dir}"
124     destdir="${build.ant.dir}"
125     source="1.4"
126     />
127     </target>
128    
129    
130     <target name="filter-src" depends="compile-ant">
131     <mkdir dir="${build.filter.src.dir}"/>
132     <copy todir="${build.filter.src.dir}">
133     <fileset dir="${src.dir}">
134     <include name="**/*.java"/>
135     </fileset>
136     <filterchain>
137     <filterreader classname="jsr166.ant.filters.ReplaceFilter"
138     classpath="${build.ant.dir}">
139     <!--
140     # These arguments are to get rid of angle-bracketed type
141     # parameters so that javadoc can run on the result. The
142     # following heuristic that seems to work:
143     #
144     # For all lines not starting with space(s)-asterisk-space(s),
145     # replace <something> with a space, where there may be more
146     # than one right angle bracket at the end, and "something"
147     # must not contain parens or pipes. (This may need some
148     # tweaking.)
149     -->
150     <param name="notmatching" value="^\s+\*\s.*$"/>
151     <param name="pattern" value="&lt;[^|>()]+?>+"/>
152     <param name="replacement" value=" "/>
153     </filterreader>
154     <filterreader classname="jsr166.ant.filters.ReplaceFilter"
155     classpath="${build.ant.dir}">
156     <!--
157     # These arguments are to uncomment lines beginning with
158     # "//@" so that javadoc can see imports that are needed
159     # to resolve links but that shouldn't be in the compiled
160     # code.
161     -->
162     <param name="matching" value="^//@.*$"/>
163     <param name="pattern" value="^//@"/>
164     <param name="replacement" value=""/>
165     </filterreader>
166     </filterchain>
167     </copy>
168     </target>
169    
170    
171     <!-- Internal targets used by test target -->
172    
173     <target name="compile-tests" depends="jar">
174     <mkdir dir="${build.testcases.dir}"/>
175     <javac srcdir="${test.src.dir}"
176     destdir="${build.testcases.dir}"
177     debug="${build.debug}"
178     debuglevel="${build.debuglevel}"
179     deprecation="${build.deprecation}"
180     source="${build.sourcelevel}"
181     fork="true">
182    
183 tim 1.2 <bootclasspath refid="gj.compiler.bootclasspath"/>
184 tim 1.1 <compilerarg line="${gj.compiler.args}"/>
185 tim 1.2 <classpath refid="test.classpath"/>
186 tim 1.1 <include name="**/*Test.java"/>
187    
188     </javac>
189     </target>
190    
191     <target name="run-tests" depends="compile-tests">
192     <mkdir dir="${build.reports.dir}"/>
193     <junit printsummary="true"
194     showoutput="true"
195     errorProperty="junit.failed"
196     failureProperty="junit.failed"
197     dir="${build.reports.dir}">
198    
199     <classpath>
200     <path refid="test.classpath"/>
201     <pathelement location="${build.testcases.dir}"/>
202     </classpath>
203    
204     <formatter type="xml"/>
205    
206     <batchtest todir="${build.reports.dir}">
207     <fileset dir="${test.src.dir}">
208     <include name="**/*Test.java"/>
209     </fileset>
210     </batchtest>
211    
212     </junit>
213     </target>
214    
215    
216     <target name="report-tests" depends="run-tests">
217     <!-- Sets junit.report.format to frames if Xalan is present,
218     otherwise sets it to noframes. -->
219     <available property="junit.report.format"
220     value="frames"
221     classname="org.apache.xalan.lib.Redirect"
222     />
223     <property name="junit.report.format" value="noframes"/>
224    
225     <junitreport todir="${build.reports.dir}">
226     <fileset dir="${build.reports.dir}">
227     <include name="TEST-*.xml"/>
228     </fileset>
229     <report styledir="${stylesheet.dir}"
230     format="${junit.report.format}"
231     todir="${build.reports.dir}"
232     />
233     </junitreport>
234    
235     <fail message="Test Cases Failed" if="junit.failed"/>
236     </target>
237    
238    
239     </project>