[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.2, Tue Oct 8 14:43:34 2002 UTC revision 1.13, Wed Dec 11 22:52:29 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
8        test target to work. [FIXME: This should be automatically
9        enforced by this build file by failing with a message if
10        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 26  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 34  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>
57    
58    <path id="test.classpath">    <path id="test.classpath">
59      <pathelement location="${product.jar}"/>      <pathelement location="${product.jar}"/>
     <pathelement location="${junit.jar}"/>  
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 59  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 69  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 77  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="docs" depends="init, clean-filtered-src, filter-src"
100              description="Builds javadocs with custom tags to build folder">
101      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
102      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
103      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
# Line 90  Line 107 
107    
108        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
109        <tag name="spec" description="Specified by:"/>        <tag name="spec" description="Specified by:"/>
110          <tag name="editor" description="Last edited by:"/>
111          <tag name="fixme" description="FIX ME:"/>
112        <packageset dir="${build.filter.src.dir}">        <packageset dir="${build.filter.src.dir}">
113          <include name="java/**"/>          <include name="java/**"/>
114        </packageset>        </packageset>
# Line 99  Line 117 
117    </target>    </target>
118    
119    
120    <target name="clean">    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/>
121    
122    
123      <target name="clean"
124              description="Removes all build products">
125      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
126      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
127      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
     <delete dir="${build.javadocs.dir}"/>  
128    </target>    </target>
129    
130    
131    <!-- Internal targets used by docs target -->    <target name="dist-clean"
132              description="Removes all build and distribution products">
133        <delete dir="${dist.dir}"/>
134      </target>
135    
136    
137      <!-- Internal targets -->
138    
139      <target name="set-warnings-if" if="build.warnings">
140        <property name="build.warnings.option" value="-warnunchecked"/>
141      </target>
142    
143      <target name="set-warnings-unless" unless="build.warnings">
144        <property name="build.warnings.option" value=""/>
145      </target>
146    
147      <target name="init" depends="set-warnings-if, set-warnings-unless">
148        <!-- Version is kept in a separate file -->
149        <loadfile property="version" srcFile="version.properties"/>
150        <echo>Building JSR-166 version ${version}</echo>
151      </target>
152    
153    
154      <target name="clean-filtered-src">
155        <delete dir="${build.filter.src.dir}"/>
156      </target>
157    
158    
159      <target name="dist-jar" depends="clean, jar">
160        <copy file="${product.jar}" todir="${dist.dir}"/>
161      </target>
162    
163    
164      <target name="dist-docs" depends="clean-filtered-src, filter-src"
165              description="Builds javadocs without custom tags to dist folder">
166        <delete dir="${dist.javadocs.dir}"/>
167        <mkdir dir="${dist.javadocs.dir}"/>
168        <javadoc destdir="${dist.javadocs.dir}"
169                    link="http://java.sun.com/j2se/1.4.1/docs/api"
170                overview="${src.dir}/intro.html"
171                  source="${build.sourcelevel}">
172    
173          <packageset dir="${build.filter.src.dir}">
174            <include name="java/**"/>
175          </packageset>
176    
177        </javadoc>
178      </target>
179    
180    <target name="compile-ant">  
181      <target name="compile-ant-filter">
182      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
183      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
184            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
# Line 118  Line 187 
187    </target>    </target>
188    
189    
190    <target name="filter-src" depends="compile-ant">    <target name="filter-src" depends="compile-ant-filter">
191      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
192      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
193        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
# Line 159  Line 228 
228    </target>    </target>
229    
230    
   <!-- Internal targets used by test target -->  
   
231    <target name="compile-tests" depends="jar">    <target name="compile-tests" depends="jar">
232      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
233      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
# Line 171  Line 238 
238             source="${build.sourcelevel}"             source="${build.sourcelevel}"
239               fork="true">               fork="true">
240    
241        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
242        <compilerarg line="${gj.compiler.args}"/>        <compilerarg line="${javac.args} ${build.warnings.option}"/>
243        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
244        <include name="**/*Test.java"/>        <include name="**/*Test.java"/>
245    
246      </javac>      </javac>
247    </target>    </target>
248    
249    
250    <target name="run-tests" depends="compile-tests">    <target name="run-tests" depends="compile-tests">
251      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
252      <junit printsummary="true"      <junit printsummary="true"
253               showoutput="true"               showoutput="true"
254            errorProperty="junit.failed"            errorProperty="junit.failed"
255          failureProperty="junit.failed"          failureProperty="junit.failed"
256                      dir="${build.reports.dir}">                      dir="${build.reports.dir}"
257                       fork="true">
258    
259          <jvmarg value="-Xbootclasspath/p:${product.jar}"/>
260    
261        <classpath>        <classpath>
262          <path refid="test.classpath"/>          <!-- <path refid="test.classpath"/> -->
263          <pathelement location="${build.testcases.dir}"/>          <pathelement location="${build.testcases.dir}"/>
264        </classpath>        </classpath>
265    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.13

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8