1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
|
<?xml version="1.0" encoding="UTF-8"?>
<project name="JEL" default="main" basedir=".">
<property name="jel.version" value="2.1.2"/>
<property name="junit.jar" value="/usr/share/java/junit.jar"/>
<property name="dist.dir" value="build/dist"/>
<property name="javadoc.path" value="/usr/share/doc/sun-java6-jdk/html/api"/>
<tstamp>
<format property="build.year" pattern="yyyy"/>
</tstamp>
<path id="compile.classpath">
<!-- <path refid="torque.classpath"/> -->
</path>
<path id="test.classpath">
<path refid="compile.classpath"/>
<pathelement location="${junit.jar}"/>
<pathelement location="build/classes"/>
<pathelement location="build/test-classes"/>
</path>
<path id="test.classpath.opt">
<path refid="compile.classpath"/>
<pathelement location="${junit.jar}"/>
<pathelement location="build/classes-opt"/>
<pathelement location="build/test-classes"/>
</path>
<path id="test.dist.classpath">
<path refid="compile.classpath"/>
<pathelement location="${junit.jar}"/>
<pathelement location="build/test-classes"/>
<pathelement location="${dist.dir}/lib/jel_g.jar"/>
</path>
<path id="test.dist.classpath.opt">
<path refid="compile.classpath"/>
<pathelement location="${junit.jar}"/>
<pathelement location="build/test-classes"/>
<pathelement location="${dist.dir}/lib/jel.jar"/>
</path>
<target
name="init"
description="==> init directories">
<mkdir dir="build/classes"/>
<mkdir dir="build/javadoc"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/lib"/>
<mkdir dir="build/classes-opt"/>
<mkdir dir="build/test-classes"/>
<mkdir dir="build/test-data"/>
<mkdir dir="build/test-data-opt"/>
<mkdir dir="build/test-reports"/>
<!-- for generated distribution -->
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/docs"/>
<mkdir dir="${dist.dir}/docs/api"/>
<mkdir dir="${dist.dir}/lib"/>
<mkdir dir="${dist.dir}/source"/>
<mkdir dir="${dist.dir}/source/src"/>
<mkdir dir="${dist.dir}/source/third-party"/>
<mkdir dir="${dist.dir}/samples"/>
<mkdir dir="${dist.dir}/samples/testsuite"/>
<mkdir dir="${dist.dir}/samples/testbed"/>
<mkdir dir="${dist.dir}/samples/calculator"/>
<!-- enable debugging in the work build -->
<mkdir dir="build/src/java/gnu/jel/debug"/>
<copy file="src/java/gnu/jel/debug/Debug.java" todir="build/src/java/gnu/jel/debug/">
<filterset>
<filter token="DEBUG" value="true"/>
</filterset>
</copy>
<mkdir dir="build/src/java-opt/gnu/jel/debug"/>
<copy file="src/java/gnu/jel/debug/Debug.java" todir="build/src/java-opt/gnu/jel/debug/">
<filterset>
<filter token="DEBUG" value="false"/>
</filterset>
</copy>
</target>
<uptodate property="tables.uptodate"
srcfile="src/java/gnu/jel/TableWriter.java"
targetfile="build/classes/gnu/jel/tables.dat"/>
<target name="java-compile" depends="init">
<javac destdir="build/classes"
classpathref="compile.classpath"
debug="on"
includeantruntime="false"
deprecation="on">
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-fallthrough"/>
<src path="build/src/java"/>
<src path="src/java"/>
<exclude name="gnu/jel/debug/Debug.java"/>
</javac>
<javac destdir="build/classes-opt"
classpathref="compile.classpath"
debug="off"
includeantruntime="false"
deprecation="on">
<src path="build/src/java-opt"/>
<src path="src/java"/>
<exclude name="gnu/jel/debug/Debug.java"/>
</javac>
</target>
<target name="generate-tables" depends="java-compile"
unless="tables.uptodate">
<copy file="src/java/gnu/jel/JEL.properties" todir="build/classes/gnu/jel"/>
<echo message="Generating tables..." />
<java
classpathref="test.classpath"
classname="gnu.jel.TableWriter"
dir="build/classes"
fork="true"
/>
<copy file="build/classes/gnu/jel/tables.dat" todir="build/classes-opt/gnu/jel"/>
<copy file="src/java/gnu/jel/JEL.properties" todir="build/classes-opt/gnu/jel"/>
</target>
<target name="compile" depends="generate-tables"/>
<target
name="test-compile" depends="compile">
<javac srcdir="src/tests"
destdir="build/test-classes"
debug="on"
deprecation="on"
includeantruntime="false"
classpathref="test.classpath">
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-fallthrough"/>
</javac>
</target>
<target
name="test" depends="compile,test-compile">
<junit printsummary="false" fork="on"
errorProperty="test.failed"
failureProperty="test.failed">
<classpath refid="test.classpath"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="build/test-data">
<fileset dir="build/test-classes" includes="**/*Test.class"/>
</batchtest>
</junit>
<junit printsummary="false" fork="on"
errorProperty="test.failed"
failureProperty="test.failed">
<classpath refid="test.classpath.opt"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="build/test-data-opt">
<fileset dir="build/test-classes" includes="**/*Test.class"/>
</batchtest>
</junit>
<junitreport todir="build/test-data">
<fileset dir="build/test-data">
<include name="TEST-*.xml"/>
</fileset>
<fileset dir="build/test-data-opt">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="build/test-reports"/>
</junitreport>
<fail message="Tests failed, see the reports & logs..."
if="test.failed"/>
</target>
<target name="clean" description="==> clean up the generated directories">
<delete dir="build/">
</delete>
</target>
<target name="javadoc">
<javadoc packagenames="gnu.jel.*"
defaultexcludes="yes"
destdir="build/javadoc"
author="true"
version="true"
use="true"
windowtitle="JEL API">
<fileset dir="src/java/" defaultexcludes="yes">
<include name="gnu/jel/**/*.java" />
<exclude name="gnu/jel/debug/Debug.java"/>
</fileset>
<fileset dir="build/src/java/" defaultexcludes="yes">
<include name="gnu/jel/debug/Debug.java"/>
</fileset>
<doctitle><![CDATA[<h1>JEL</h1>]]></doctitle>
<bottom><![CDATA[<p><i>Copyright © 1998-${build.year} Konstantin L. Metlov All Rights Reserved.</i></p><p>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the JEL manual.</p>]]></bottom>
<!-- <tag name="todo" scope="all" description="To do:" /> -->
<link offline="true" href="http://java.sun.com/javase/6/docs/api/" packagelistLoc="${javadoc.path}"/>
</javadoc>
</target>
<target name="dist" depends="compile,test-compile,javadoc"
description="make the distribution">
<jar destfile="${dist.dir}/lib/jel.jar">
<fileset dir="build/classes-opt/">
<include name="**/*.class"/>
<exclude name="gnu/jel/debug/Debug.class"/>
<exclude name="gnu/jel/TableWriter.class"/>
<exclude name="*.class"/>
<include name="gnu/jel/tables.dat"/>
<include name="gnu/jel/JEL.properties"/>
</fileset>
</jar>
<jar destfile="${dist.dir}/lib/jel_g.jar">
<fileset dir="build/classes/">
<include name="**/*.class"/>
<exclude name="*.class"/>
<include name="gnu/jel/tables.dat"/>
<include name="gnu/jel/JEL.properties"/>
</fileset>
</jar>
<jar destfile="${dist.dir}/samples/testsuite/tests.jar">
<manifest>
<attribute name="Main-Class" value="gnu.jel.JELTestSuite"/>
<attribute name="Class-Path" value="${junit.jar} ../../lib/jel.jar"/>
</manifest>
<fileset dir="build/test-classes/">
<include name="**/*.class"/>
</fileset>
</jar>
<copy file="src/docs/README.testsuite" tofile="${dist.dir}/samples/testsuite/README"/>
<copy file="${junit.jar}" todir="${dist.dir}/source/third-party"/>
<copy todir="${dist.dir}/source/src">
<fileset dir="src/"> <!-- these files are for WWW site only -->
<exclude name="docs/html/index.html"/>
<exclude name="docs/html/back1.gif"/>
<exclude name="docs/html/gnu-head-sm-transp.png"/>
<exclude name="docs/html/jel.css"/>
<exclude name="docs/html/license.txt"/>
</fileset>
<filterset>
<filter token="date" value="${TODAY}"/>
<filter token="year" value="${build.year}"/>
<filter token="version" value="${jel.version}"/>
</filterset>
</copy>
<copy file="build.xml" todir="${dist.dir}/source/"/>
<!-- test bed -->
<copy todir="${dist.dir}/samples/testbed">
<fileset dir="src/java/">
<include name="DVResolverProvider.java"/>
<include name="Data.java"/>
<include name="GlobalContext.java"/>
<include name="YourTestBed.java"/>
</fileset>
</copy>
<copy file="src/docs/README.calculator" tofile="${dist.dir}/samples/calculator/README"/>
<!-- calculator -->
<copy todir="${dist.dir}/samples/calculator">
<fileset file="src/java/Calculator.java"/>
<fileset file="build/classes/Calculator.class"/>
</copy>
<!-- html hand-written docs -->
<copy todir="${dist.dir}/docs">
<fileset dir="src/docs/html"><!-- these files are for WWW site only -->
<exclude name="index.html"/>
<exclude name="back1.gif"/>
<exclude name="gnu-head-sm-transp.png"/>
<exclude name="jel.css"/>
<exclude name="license.txt"/>
</fileset>
</copy>
<copy todir="${dist.dir}/docs/api">
<fileset dir="build/javadoc"/>
</copy>
<copy todir="${dist.dir}">
<fileset dir="src/docs">
<include name="CODEGEN_HOW_TO"/>
<include name="COPYING"/>
<include name="README"/>
<include name="RELNOTES"/>
</fileset>
<filterset>
<filter token="date" value="${TODAY}"/>
<filter token="year" value="${build.year}"/>
<filter token="version" value="${jel.version}"/>
</filterset>
</copy>
</target>
<target
name="dist-test" depends="dist,test-compile">
<junit printsummary="false" fork="on"
errorProperty="test.failed"
failureProperty="test.failed">
<classpath refid="test.dist.classpath"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="build/test-data">
<fileset dir="build/test-classes" includes="**/*Test.class"/>
</batchtest>
</junit>
<junit printsummary="false" fork="on"
errorProperty="test.failed"
failureProperty="test.failed">
<classpath refid="test.dist.classpath.opt"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="build/test-data-opt">
<fileset dir="build/test-classes" includes="**/*Test.class"/>
</batchtest>
</junit>
<junitreport todir="build/test-data">
<fileset dir="build/test-data">
<include name="TEST-*.xml"/>
</fileset>
<fileset dir="build/test-data-opt">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="build/test-reports"/>
</junitreport>
<fail message="Tests failed, see the reports & logs..."
if="test.failed"/>
</target>
</project>
|