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

Diff of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by tim, Wed Oct 9 23:45:31 2002 UTC revision 1.50 by tim, Tue Aug 5 04:03:38 2003 UTC
# Line 1  Line 1 
1  <project name="jsr166" default="jar">  <project name="jsr166" default="usage">
2    
3    <description>    <description>
4      Build file for JSR-166  ------------------------------------------------------------------------------
5      Build file for JSR-166
6    
7      Note that junit.jar must be in ${ant.home}/lib for the    Usage: ant [target]
8      test target to work. [FIXME: This should be automatically  
9      enforced by this build file by failing with a message if    User-specific settings are read from user.properties.
10      junit.jar is not in the right place.]    See user.properties.sample for an explanation of some useful settings.
11    ------------------------------------------------------------------------------
12    </description>    </description>
13    
14      <target name="usage" description="Advises user to run with -projecthelp">
15        <echo>Run "ant -projecthelp" for full usage information.</echo>
16      </target>
17    
18    
19      <!-- User-specific settings -->
20      <property file="user.properties"/>
21    
22    
23    <!-- Compilation options -->    <!-- Compilation options -->
24      <property name="build.sourcelevel"    value="1.5"/>
25      <property name="build.docsourcelevel" value="1.4"/>
26    <property name="build.debug"          value="true"/>    <property name="build.debug"          value="true"/>
27    <property name="build.debuglevel"     value="source,lines,vars"/>    <property name="build.debuglevel"     value="source,lines,vars"/>
28    <property name="build.deprecation"    value="false"/>    <property name="build.deprecation"    value="false"/>
   <property name="build.sourcelevel"    value="1.4"/>  
29    
30    <!-- Build locations -->    <!-- Build locations -->
31    <property name="build.dir"            location="build"/>    <property name="build.dir"            location="build"/>
32    <property name="build.classes.dir"    location="${build.dir}/classes"/>    <property name="build.classes.dir"    location="${build.dir}/classes"/>
33      <property name="build.emulation.dir"  location="${build.dir}/emulation"/>
34    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
35    <property name="build.lib.dir"        location="${build.dir}/lib"/>    <property name="build.lib.dir"        location="${build.dir}/lib"/>
36    <property name="build.ant.dir"        location="${build.dir}/ant"/>    <property name="build.ant.dir"        location="${build.dir}/ant"/>
37    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
38      <property name="build.stripped.dir"   location="${build.dir}/stripped"/>
39    <property name="build.reports.dir"    location="${build.dir}/reports"/>    <property name="build.reports.dir"    location="${build.dir}/reports"/>
40      <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
41    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
42      <property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/>
43    
44    <!-- Source locations -->    <!-- Source locations -->
45    <property name="src.dir"              location="${basedir}"/>    <property name="src.dir"              location="${basedir}/src/main"/>
46    <property name="test.src.dir"         location="${basedir}/etc/testcases"/>    <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
47      <property name="test.src.dir"         location="${basedir}/src/test"/>
48    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
49    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
50    <property name="lib.dir"              location="${basedir}/lib"/>    <property name="lib.dir"              location="${basedir}/lib"/>
51      <property name="dist.dir"             location="${basedir}/dist"/>
52    
53      <!-- Distribution locations -->
54      <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
55    
56    <!-- Jar locations -->    <!-- Jar locations -->
57    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
   <property name="javac.jar"            location="${lib.dir}/javac.jar"/>  
   <property name="collect.jar"          location="${lib.dir}/collect.jar"/>  
58    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
59    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>    <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
60      <property name="sinjdoc.jar"          location="${lib.dir}/sinjdoc.jar"/>
61    
62    
63    <property name="gj.compiler.args"    <!-- Files excluded from dist-docs and emulation jar -->
64             value='-J-Xbootclasspath/p:${javac.jar} -gj'    <patternset id="unsafe.exclusion">
65    />      <exclude name="java/util/Random.*"/>
66        <exclude name="sun/misc/Unsafe.*"/>
67      </patternset>
68    
69    <path id="gj.compiler.bootclasspath">    <!-- Files excludes from emulation jar -->
70      <pathelement location="${collect.jar}"/>    <patternset id="atomic.exclusion">
71      <pathelement location="${rt.jar}"/>      <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
72    </path>      <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
73        <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
74        <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
75        <exclude name="java/util/concurrent/locks/LockSupport*"/>
76        <exclude name="java/util/concurrent/locks/ReentrantLock*"/>
77      </patternset>
78    
   <path id="test.classpath">  
     <pathelement location="${product.jar}"/>  
   </path>  
79    
80    
81    <target name="compile">    <!-- Main targets -->
82    
83      <target name="compile"
84              depends="init, configure-compiler, prepare-src"
85              description="Compiles main sources to build folder">
86    
87        <property name="prepare.src.dir" value="${src.dir}"/>
88    
89      <mkdir dir="${build.classes.dir}"/>      <mkdir dir="${build.classes.dir}"/>
90      <javac srcdir="${src.dir}"  
91    <!--
92        <echo>javac ${gjc.args}</echo>
93        <echo>bootclasspath=${compile.bootclasspath}</echo>
94    -->
95    
96        <javac srcdir="${prepare.src.dir}"
97            destdir="${build.classes.dir}"            destdir="${build.classes.dir}"
98              debug="${build.debug}"              debug="${build.debug}"
99         debuglevel="${build.debuglevel}"         debuglevel="${build.debuglevel}"
# Line 63  Line 101 
101             source="${build.sourcelevel}"             source="${build.sourcelevel}"
102               fork="true">               fork="true">
103    
104        <bootclasspath refid="gj.compiler.bootclasspath"/>        <compilerarg    line="${gjc.args}"/>
105        <compilerarg line="${gj.compiler.args}"/>        <bootclasspath refid="compile.bootclasspath"/>
   
       <!-- need this because srcdir is basedir! -->  
       <include name="java/**/*.java"/>  
106    
107      </javac>      </javac>
108    
109    </target>    </target>
110    
111    
112    <target name="jar" depends="compile">    <target name="jar"
113      <mkdir dir="${build.lib.dir}"/>            depends="configure-emulation, init-jar, native-jar, emulation-jar"
114      <jar basedir="${build.classes.dir}"            description="Builds library jar from compiled sources"/>
115          destfile="${product.jar}"  
116      />  
117      <target name="test"
118              depends="init, configure-tests, report-tests"
119              description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
120    
121    
122      <target name="checkstyle"
123              depends="filter-src"
124              description="Reports on style errors in Java source (verbose, mostly chaff)">
125    
126        <taskdef resource="checkstyletask.properties"
127                classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
128    
129        <checkstyle>
130          <formatter type="plain"/>  <!-- also available: type="xml" -->
131          <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
132        </checkstyle>
133    
134    </target>    </target>
135    
136    
137    <target name="test" depends="report-tests"/>    <target name="doccheck"
138              depends="filter-doccheck"
139              description="Reports on javadoc style errors">
140    
141        <delete dir="${build.doccheck.dir}"/>
142        <mkdir dir="${build.doccheck.dir}"/>
143    
144        <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
145             docletpath="${lib.dir}/doccheck.jar"
146                destdir="${build.doccheck.dir}">
147          <packageset dir="${build.filter.doccheck.dir}"/>
148        </javadoc>
149    
150        <echo>DocCheck output is in ${build.doccheck.dir}</echo>
151    
152      </target>
153    
154    
155      <target name="docs"
156              depends="filter-src"
157              description="Builds javadocs with custom tags to build folder">
158    
   <target name="docs" depends="filter-src">  
159      <delete dir="${build.javadocs.dir}"/>      <delete dir="${build.javadocs.dir}"/>
160      <mkdir dir="${build.javadocs.dir}"/>      <mkdir dir="${build.javadocs.dir}"/>
161    
162      <javadoc destdir="${build.javadocs.dir}"      <javadoc destdir="${build.javadocs.dir}"
163                  link="http://java.sun.com/j2se/1.4.1/docs/api"                  link="http://java.sun.com/j2se/1.4.1/docs/api"
164              overview="${src.dir}/intro.html"              overview="${src.dir}/intro.html"
165                source="${build.sourcelevel}">                source="${build.docsourcelevel}">
166    
167        <tag name="revised" description="Last revised:"/>        <tag name="revised" description="Last revised:"/>
168        <tag name="spec" description="Specified by:"/>        <tag name="spec"    description="Specified by:"/>
169          <tag name="editor"  description="Last edited by:"/>
170          <tag name="fixme"   description="FIX ME:"/>
171    
172        <packageset dir="${build.filter.src.dir}">        <packageset dir="${build.filter.src.dir}"/>
         <include name="java/**"/>  
       </packageset>  
173    
174      </javadoc>      </javadoc>
175    
176      </target>
177    
178    
179      <target name="sinjdocs"
180              depends="configure-tests"
181              description="Builds javadocs with custom tags to build folder">
182    
183        <delete dir="${build.javadocs.dir}"/>
184        <mkdir dir="${build.javadocs.dir}"/>
185    
186        <java classname="net.cscott.sinjdoc.Main" fork="true">
187    
188          <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
189    
190          <classpath>
191            <pathelement location="${sinjdoc.jar}"/>
192            <path refid="test.classpath"/>
193          </classpath>
194    
195          <!-- <arg value="-link"/>       <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> -->
196    
197          <arg value="-d"/>          <arg value="${build.javadocs.dir}"/>
198          <arg value="-sourcepath"/> <arg value="${src.dir}"/>
199          <arg value="-overview"/>   <arg value="${src.dir}/intro.html"/>
200          <arg value="-source"/>     <arg value="1.5"/>
201          <arg value="-verbose"/>
202          <arg value="java.util"/>
203    
204          <!--
205          <arg value="-help"/>
206          -->
207    
208        </java>
209    
210      </target>
211    
212    
213      <target name="strip"
214              depends="init, configure-compiler"
215              description="Strip generics from java source (not working yet)">
216    
217        <mkdir dir="${build.stripped.dir}"/>
218    
219        <!--
220         # javac -s doesn't reliably generate compilable code. It generates
221         # bridge methods (marked as "synthetic") that can have identical
222         # signatures to existing methods except for the return value.
223         -->
224        <javac srcdir="${src.dir}"
225              destdir="${build.stripped.dir}"
226                debug="${build.debug}"
227           debuglevel="${build.debuglevel}"