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

Annotation of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations)
Wed Dec 11 05:04:04 2002 UTC (16 years, 11 months ago) by tim
Branch: MAIN
Changes since 1.8: +31 -19 lines
File MIME type: text/xml
Public docs go to dist folder, private docs stay in build folder.

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

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