[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.11, Wed Dec 11 15:59:11 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="true"/>
19    <property name="build.sourcelevel"    value="1.4"/>    <property name="build.warnings"       value="true"/>
20    
21    <!-- Build locations -->    <!-- Build locations -->
22    <property name="build.dir"            location="build"/>    <property name="build.dir"            location="build"/>
# Line 26  Line 34 
34    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
35    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
36    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
37      <property name="dist.dir"             location="${basedir}/dist"/>
38    
39      <!-- Distribution locations -->
40      <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
41    
42    <!-- Jar locations -->    <!-- Jar locations -->
43    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
# Line 34  Line 46 
46    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
47    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
48    
49    <property name="gj.compiler.args"    <property name="javac.args"           value='-J-Xbootclasspath/p:${javac.jar}'/>
            value='-J-Xbootclasspath/p:${javac.jar} -gj'  
   />  
50    
51    <path id="gj.compiler.bootclasspath">    <path id="javac.bootclasspath">
52      <pathelement location="${collect.jar}"/>      <pathelement location="${collect.jar}"/>
53      <pathelement location="${rt.jar}"/>      <pathelement location="${rt.jar}"/>
54    </path>    </path>
55    
56    <path id="test.classpath">    <path id="test.classpath">
57      <pathelement location="${product.jar}"/>      <pathelement location="${product.jar}"/>
     <pathelement location="${junit.jar}"/>  
58    </path>    </path>
59    
60    
61    <target name="compile">    <!-- Main targets -->
62    
63      <target name="compile" depends="init"
64              description="Compiles all sources to build folder">
65      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
66      <javac srcdir="${src.dir}"      <javac srcdir="${src.dir}"
67            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
# Line 59  Line 71 
71             source="${build.sourcelevel}"             source="${build.sourcelevel}"
72               fork="true">               fork="true">
73    
74        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
75        <compilerarg line="${gj.compiler.args}"/>        <compilerarg line="${javac.args} ${build.warnings.option}"/>
76    
77        <!-- need this because srcdir is basedir! -->        <!-- need this because srcdir is basedir! -->
78        <include name="java/**/*.java"/>        <include name="java/**/*.java"/>
# Line 69  Line 81 
81    </target>    </target>
82    
83    
84    <target name="jar" depends="compile">    <target name="jar" depends="compile"
85              description="Builds library jar from compiled sources">
86      <mkdir dir="${build.lib.dir}"/>      <mkdir dir="${build.lib.dir}"/>
87      <jar basedir="${build.classes.dir}"      <jar basedir="${build.classes.dir}"
88          destfile="${product.jar}"          destfile="${product.jar}"
# Line 77  Line 90 
90    </target>    </target>
91    
92    
93    <target name="test" depends="report-tests"/>    <target name="test" depends="init, report-tests"
94              description="Runs all tests"/>
95    
96    
97    <target name="docs" depends="filter-src">    <target name="docs" depends="init, clean-filtered-src, filter-src"
98              description="Builds javadocs with custom tags to build folder">
99      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
100      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
101      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
# Line 90  Line 105 
105    
106        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
107        <tag name="spec" description="Specified by:"/>        <tag name="spec" description="Specified by:"/>
108          <tag name="editor" description="Last edited by:"/>
109          <tag name="fixme" description="FIX ME:"/>
110        <packageset dir="${build.filter.src.dir}">        <packageset dir="${build.filter.src.dir}">
111          <include name="java/**"/>          <include name="java/**"/>
112        </packageset>        </packageset>
# Line 99  Line 115 
115    </target>    </target>
116    
117    
118    <target name="clean">    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/>
119    
120    
121      <target name="clean"
122              description="Removes all build products">
123      <delete dir="${build.dir}"/>      <delete dir="${build.dir}"/>
124      <delete dir="${build.classes.dir}"/>      <delete dir="${build.classes.dir}"/>
125      <delete dir="${build.lib.dir}"/>      <delete dir="${build.lib.dir}"/>
     <delete dir="${build.javadocs.dir}"/>  
126    </target>    </target>
127    
128    
129    <!-- Internal targets used by docs target -->    <target name="dist-clean"
130              description="Removes all build and distribution products">
131        <delete dir="${dist.dir}"/>
132      </target>
133    
134    
135      <!-- Internal targets -->
136    
137      <target name="set-warnings-if" if="build.warnings">
138        <property name="build.warnings.option" value="-warnunchecked"/>
139      </target>
140    
141      <target name="set-warnings-unless" unless="build.warnings">
142        <property name="build.warnings.option" value=""/>
143      </target>
144    
145      <target name="init" depends="set-warnings-if, set-warnings-unless">
146        <!-- Version is kept in a separate file -->
147        <loadfile property="version" srcFile="version.properties"/>
148        <echo>Building JSR-166 version ${version}</echo>
149      </target>
150    
151    
152      <target name="clean-filtered-src">
153        <delete dir="${build.filter.src.dir}"/>
154      </target>
155    
156    
157      <target name="dist-jar" depends="clean, jar">
158        <copy file="${product.jar}" todir="${dist.dir}"/>
159      </target>
160    
161    
162      <target name="dist-docs" depends="clean-filtered-src, filter-src"
163              description="Builds javadocs without custom tags to dist folder">
164        <delete dir="${dist.javadocs.dir}"/>
165        <mkdir dir="${dist.javadocs.dir}"/>
166        <javadoc destdir="${dist.javadocs.dir}"
167                    link="http://java.sun.com/j2se/1.4.1/docs/api"
168                overview="${src.dir}/intro.html"
169                  source="${build.sourcelevel}">
170    
171          <packageset dir="${build.filter.src.dir}">
172            <include name="java/**"/>
173          </packageset>
174    
175        </javadoc>
176      </target>
177    
178    
179    <target name="compile-ant">    <target name="compile-ant-filter">
180      <mkdir dir="${build.ant.dir}"/>      <mkdir dir="${build.ant.dir}"/>
181      <javac srcdir="${ant.src.dir}"      <javac srcdir="${ant.src.dir}"
182            destdir="${build.ant.dir}"            destdir="${build.ant.dir}"
# Line 118  Line 185 
185    </target>    </target>
186    
187    
188    <target name="filter-src" depends="compile-ant">    <target name="filter-src" depends="compile-ant-filter">
189      <mkdir dir="${build.filter.src.dir}"/>      <mkdir dir="${build.filter.src.dir}"/>
190      <copy todir="${build.filter.src.dir}">      <copy todir="${build.filter.src.dir}">
191        <fileset dir="${src.dir}">        <fileset dir="${src.dir}">
# Line 159  Line 226 
226    </target>    </target>
227    
228    
   <!-- Internal targets used by test target -->  
   
229    <target name="compile-tests" depends="jar">    <target name="compile-tests" depends="jar">
230      <mkdir dir="${build.testcases.dir}"/>      <mkdir dir="${build.testcases.dir}"/>
231      <javac srcdir="${test.src.dir}"      <javac srcdir="${test.src.dir}"
# Line 171  Line 236 
236             source="${build.sourcelevel}"             source="${build.sourcelevel}"
237               fork="true">               fork="true">
238    
239        <bootclasspath refid="gj.compiler.bootclasspath"/>        <bootclasspath refid="javac.bootclasspath"/>
240        <compilerarg line="${gj.compiler.args}"/>        <compilerarg line="${javac.args} ${build.warnings.option}"/>
241        <classpath refid="test.classpath"/>        <classpath refid="test.classpath"/>
242        <include name="**/*Test.java"/>        <include name="**/*Test.java"/>
243    
244      </javac>      </javac>
245    </target>    </target>
246    
247    
248    <target name="run-tests" depends="compile-tests">    <target name="run-tests" depends="compile-tests">
249      <mkdir dir="${build.reports.dir}"/>      <mkdir dir="${build.reports.dir}"/>
250      <junit printsummary="true"      <junit printsummary="true"

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

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8