ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
Revision: 1.4
Committed: Wed Dec 4 04:30:54 2002 UTC (21 years, 4 months ago) by dholmes
Content type: text/xml
Branch: MAIN
Changes since 1.3: +2 -1 lines
Log Message:
Added more custom tags

File Contents

# Content
1 <project name="jsr166" default="jar">
2
3 <description>
4 Build file for JSR-166
5
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 </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 <property name="build.sourcelevel" value="1.4"/>
17
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 value='-J-Xbootclasspath/p:${javac.jar} -gj'
44 />
45
46 <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
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 <bootclasspath refid="gj.compiler.bootclasspath"/>
67 <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 <target name="docs" depends="filter-src">
88 <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 <tag name="editor" description="Last edited by:"/>
98 <tag name="fixme" description="FIX ME:"/>
99 <packageset dir="${build.filter.src.dir}">
100 <include name="java/**"/>
101 </packageset>
102
103 </javadoc>
104 </target>
105
106
107 <target name="clean">
108 <delete dir="${build.dir}"/>
109 <delete dir="${build.classes.dir}"/>
110 <delete dir="${build.lib.dir}"/>
111 <delete dir="${build.javadocs.dir}"/>
112 </target>
113
114
115 <!-- Internal targets used by docs target -->
116
117 <target name="compile-ant">
118 <mkdir dir="${build.ant.dir}"/>
119 <javac srcdir="${ant.src.dir}"
120 destdir="${build.ant.dir}"
121 source="1.4"
122 />
123 </target>
124
125
126 <target name="filter-src" depends="compile-ant">
127 <mkdir dir="${build.filter.src.dir}"/>
128 <copy todir="${build.filter.src.dir}">
129 <fileset dir="${src.dir}">
130 <include name="**/*.java"/>
131 </fileset>
132 <filterchain>
133 <filterreader classname="jsr166.ant.filters.ReplaceFilter"
134 classpath="${build.ant.dir}">
135 <!--
136 # These arguments are to get rid of angle-bracketed type
137 # parameters so that javadoc can run on the result. The
138 # following heuristic that seems to work:
139 #
140 # For all lines not starting with space(s)-asterisk-space(s),
141 # replace <something> with a space, where there may be more
142 # than one right angle bracket at the end, and "something"
143 # must not contain parens or pipes. (This may need some
144 # tweaking.)
145 -->
146 <param name="notmatching" value="^\s+\*\s.*$"/>
147 <param name="pattern" value="&lt;[^|>()]+?>+"/>
148 <param name="replacement" value=" "/>
149 </filterreader>
150 <filterreader classname="jsr166.ant.filters.ReplaceFilter"
151 classpath="${build.ant.dir}">
152 <!--
153 # These arguments are to uncomment lines beginning with
154 # "//@" so that javadoc can see imports that are needed
155 # to resolve links but that shouldn't be in the compiled
156 # code.
157 -->
158 <param name="matching" value="^//@.*$"/>
159 <param name="pattern" value="^//@"/>
160 <param name="replacement" value=""/>
161 </filterreader>
162 </filterchain>
163 </copy>
164 </target>
165
166
167 <!-- Internal targets used by test target -->
168
169 <target name="compile-tests" depends="jar">
170 <mkdir dir="${build.testcases.dir}"/>
171 <javac srcdir="${test.src.dir}"
172 destdir="${build.testcases.dir}"
173 debug="${build.debug}"
174 debuglevel="${build.debuglevel}"
175 deprecation="${build.deprecation}"
176 source="${build.sourcelevel}"
177 fork="true">
178
179 <bootclasspath refid="gj.compiler.bootclasspath"/>
180 <compilerarg line="${gj.compiler.args}"/>
181 <classpath refid="test.classpath"/>
182 <include name="**/*Test.java"/>
183
184 </javac>
185 </target>
186
187 <target name="run-tests" depends="compile-tests">
188 <mkdir dir="${build.reports.dir}"/>
189 <junit printsummary="true"
190 showoutput="true"
191 errorProperty="junit.failed"
192 failureProperty="junit.failed"
193 dir="${build.reports.dir}">
194
195 <classpath>
196 <path refid="test.classpath"/>
197 <pathelement location="${build.testcases.dir}"/>
198 </classpath>
199
200 <formatter type="xml"/>
201
202 <batchtest todir="${build.reports.dir}">
203 <fileset dir="${test.src.dir}">
204 <include name="**/*Test.java"/>
205 </fileset>
206 </batchtest>
207
208 </junit>
209 </target>
210
211
212 <target name="report-tests" depends="run-tests">
213 <!-- Sets junit.report.format to frames if Xalan is present,
214 otherwise sets it to noframes. -->
215 <available property="junit.report.format"
216 value="frames"
217 classname="org.apache.xalan.lib.Redirect"
218 />
219 <property name="junit.report.format" value="noframes"/>
220
221 <junitreport todir="${build.reports.dir}">
222 <fileset dir="${build.reports.dir}">
223 <include name="TEST-*.xml"/>
224 </fileset>
225 <report styledir="${stylesheet.dir}"
226 format="${junit.report.format}"
227 todir="${build.reports.dir}"
228 />
229 </junitreport>
230
231 <fail message="Test Cases Failed" if="junit.failed"/>
232 </target>
233
234
235 </project>