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

Annotation of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Wed Oct 9 23:45:31 2002 UTC (17 years, 2 months ago) by tim
Branch: MAIN
Changes since 1.2: +5 -1 lines
File MIME type: text/xml
No need to include junit.jar on test.classpath, document
that it must be in ${ant.home}/lib.

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

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