[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.10, Wed Dec 11 05:16:42 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      Note that junit.jar must be in ${ant.home}/lib for the
8      test target to work. [FIXME: This should be automatically      test target to work. [FIXME: This should be automatically
9      enforced by this build file by failing with a message if      enforced by this build file by failing with a message if
10      junit.jar is not in the right place.]      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.5"/>    <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 43  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} -deprecation -warnunchecked'  
   />  
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>
# Line 57  Line 58 
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 67  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 77  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 85  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="clean-filtered-src, filter-src"    <target name="docs" depends="init, clean-filtered-src, filter-src"
98            description="Builds javadocs with custom tags to build folder">            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}"/>
# Line 109  Line 115 
115    </target>    </target>
116    
117    
118    <target name="dist-docs" depends="clean-filtered-src, filter-src"    <target name="dist" depends="init, dist-clean, dist-jar, dist-docs"/>
           description="Builds javadocs without custom tags to dist folder">  
     <delete dir="${dist.javadocs.dir}"/>  
     <mkdir dir="${dist.javadocs.dir}"/>  
     <javadoc destdir="${dist.javadocs.dir}"  
                 link="http://java.sun.com/j2se/1.4.1/docs/api"  
             overview="${src.dir}/intro.html"  
               source="${build.sourcelevel}">  
119    
       <packageset dir="${build.filter.src.dir}">  
         <include name="java/**"/>  
       </packageset>  
120    
121      </javadoc>    <target name="clean"
122              description="Removes all build products">
123        <delete dir="${build.dir}"/>
124        <delete dir="${build.classes.dir}"/>
125        <delete dir="${build.lib.dir}"/>
126    </target>    </target>
127    
128    
129    <target name="dist-jar" depends="clean, jar">    <target name="dist-clean"
130      <copy file="${product.jar}" todir="${dist.dir}"/>            description="Removes all build and distribution products">
131        <delete dir="${dist.dir}"/>
132    </target>    </target>
133    
134    
135    <target name="dist" depends="dist-clean, dist-jar, dist-docs"/>    <!-- Internal targets -->
136    
137      <target name="set-warnings-if" if="build.warnings">
138    <target name="clean">      <property name="build.warnings.option" value="-warnunchecked"/>
     <delete dir="${build.dir}"/>  
     <delete dir="${build.classes.dir}"/>  
     <delete dir="${build.lib.dir}"/>  
139    </target>    </target>
140    
141      <target name="set-warnings-unless" unless="build.warnings">
142        <property name="build.warnings.option" value=""/>
143      </target>
144    
145    <target name="dist-clean" depends="clean">    <target name="init" depends="set-warnings-if, set-warnings-unless">
146      <delete dir="${dist.dir}"/>      <!-- Version is kept in a separate file -->
147        <loadfile property="version" srcFile="version.properties"/>
148        <echo>Building JSR-166 version ${version}</echo>
149    </target>    </target>
150    
151    
# Line 151  Line 154 
154    </target>    </target>
155    
156    
157    <!-- Internal targets used by docs target -->    <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 162  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 203  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 215  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.10  
changed lines
  Added in v.1.11

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8