2015-04-20 15:36:01 -07:00
|
|
|
<?xml version="1.0" ?>
|
|
|
|
|
|
|
|
<project
|
|
|
|
basedir="."
|
|
|
|
default="run"
|
|
|
|
name="Thinking in Java, 4th Edition (Refreshed) by Bruce Eckel (chapter: enumerated)">
|
|
|
|
|
|
|
|
<description>
|
|
|
|
build.xml for the source code for the enumerated chapter of
|
|
|
|
Thinking in Java, 4th Edition (Refreshed) by Bruce Eckel
|
|
|
|
Source code available at http://www.MindView.net
|
|
|
|
See copyright notice in CopyRight.txt
|
|
|
|
|
|
|
|
Ant available from: http://ant.apache.org/
|
|
|
|
|
|
|
|
To see options, type: ant -p
|
|
|
|
</description>
|
|
|
|
|
|
|
|
<condition property="version1.8">
|
|
|
|
<equals arg1="1.8" arg2="${ant.java.version}"/>
|
|
|
|
</condition>
|
|
|
|
|
|
|
|
<target name="net_mindview_util">
|
2015-04-20 23:01:41 -07:00
|
|
|
<javac includeantruntime="false"
|
2015-04-20 15:36:01 -07:00
|
|
|
classpath="${basedir}/.."
|
|
|
|
srcdir="${basedir}/../net/mindview/util/">
|
|
|
|
<compilerarg value="-Xmaxerrs"/>
|
|
|
|
<compilerarg value="10"/>
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target
|
|
|
|
depends="net_mindview_util"
|
|
|
|
description="Build all classes in this directory"
|
|
|
|
name="build">
|
|
|
|
<fail message="J2SE8 required" unless="version1.8"/>
|
|
|
|
<echo message="Building 'enumerated'"/>
|
2015-04-20 23:01:41 -07:00
|
|
|
<javac includeantruntime="false"
|
2015-04-20 15:36:01 -07:00
|
|
|
classpath="${basedir}/.."
|
|
|
|
debug="true"
|
|
|
|
srcdir="${basedir}">
|
|
|
|
<compilerarg value="-Xmaxerrs"/>
|
|
|
|
<compilerarg value="10"/>
|
|
|
|
</javac>
|
|
|
|
<echo message="Build 'enumerated' succeeded"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="BigEnumSet">
|
|
|
|
<java
|
|
|
|
classname="BigEnumSet"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="Burrito">
|
|
|
|
<java
|
|
|
|
classname="enumerated.Burrito"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="CarWash">
|
|
|
|
<java
|
|
|
|
classname="CarWash"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="ConstantSpecificMethod">
|
|
|
|
<java
|
|
|
|
classname="ConstantSpecificMethod"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="EnumClass">
|
|
|
|
<java
|
|
|
|
classname="EnumClass"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="EnumMaps">
|
|
|
|
<java
|
|
|
|
classname="enumerated.EnumMaps"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="EnumSets">
|
|
|
|
<java
|
|
|
|
classname="enumerated.EnumSets"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="NonEnum">
|
|
|
|
<java
|
|
|
|
classname="NonEnum"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="OverrideConstantSpecific">
|
|
|
|
<java
|
|
|
|
classname="OverrideConstantSpecific"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="OzWitch">
|
|
|
|
<java
|
|
|
|
classname="OzWitch"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="PostOffice">
|
|
|
|
<java
|
|
|
|
classname="PostOffice"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="RandomTest">
|
|
|
|
<java
|
|
|
|
classname="RandomTest"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="Reflection">
|
|
|
|
<java
|
|
|
|
classname="Reflection"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="RoShamBo1">
|
|
|
|
<java
|
|
|
|
classname="enumerated.RoShamBo1"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="RoShamBo2">
|
|
|
|
<java
|
|
|
|
classname="enumerated.RoShamBo2"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="RoShamBo3">
|
|
|
|
<java
|
|
|
|
classname="enumerated.RoShamBo3"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="RoShamBo4">
|
|
|
|
<java
|
|
|
|
classname="enumerated.RoShamBo4"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="RoShamBo5">
|
|
|
|
<java
|
|
|
|
classname="enumerated.RoShamBo5"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="RoShamBo6">
|
|
|
|
<java
|
|
|
|
classname="enumerated.RoShamBo6"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="SecurityCategory">
|
|
|
|
<java
|
|
|
|
classname="SecurityCategory"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="SpaceShip">
|
|
|
|
<java
|
|
|
|
classname="SpaceShip"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="TrafficLight">
|
|
|
|
<java
|
|
|
|
classname="TrafficLight"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="UpcastEnum">
|
|
|
|
<java
|
|
|
|
classname="UpcastEnum"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="VendingMachine">
|
|
|
|
<java
|
|
|
|
classname="enumerated.VendingMachine"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true">
|
|
|
|
<arg line="VendingMachineInput.txt"/>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="EnumImplementation">
|
|
|
|
<java
|
|
|
|
classname="enumerated.cartoons.EnumImplementation"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/cartoons/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="Meal">
|
|
|
|
<java
|
|
|
|
classname="enumerated.menu.Meal"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/menu/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="Meal2">
|
|
|
|
<java
|
|
|
|
classname="enumerated.menu.Meal2"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/menu/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="TypeOfFood">
|
|
|
|
<java
|
|
|
|
classname="enumerated.menu.TypeOfFood"
|
|
|
|
classpath="${java.class.path};${basedir};${basedir}/.."
|
|
|
|
dir="../enumerated/menu/"
|
|
|
|
failonerror="true"
|
|
|
|
fork="true"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="NotClasses">
|
|
|
|
<exec executable="javap">
|
|
|
|
<arg value="-c"/>
|
|
|
|
<arg value="LikeClasses"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target
|
|
|
|
depends="build"
|
|
|
|
description="Compile and run"
|
|
|
|
name="run">
|
|
|
|
<touch file="failures"/>
|
|
|
|
<antcall target="BigEnumSet"/>
|
|
|
|
<antcall target="Burrito"/>
|
|
|
|
<antcall target="CarWash"/>
|
|
|
|
<antcall target="ConstantSpecificMethod"/>
|
|
|
|
<antcall target="EnumClass"/>
|
|
|
|
<antcall target="EnumMaps"/>
|
|
|
|
<antcall target="EnumSets"/>
|
|
|
|
<antcall target="NonEnum"/>
|
|
|
|
<antcall target="OverrideConstantSpecific"/>
|
|
|
|
<antcall target="OzWitch"/>
|
|
|
|
<antcall target="PostOffice"/>
|
|
|
|
<antcall target="RandomTest"/>
|
|
|
|
<antcall target="Reflection"/>
|
|
|
|
<antcall target="RoShamBo1"/>
|
|
|
|
<antcall target="RoShamBo2"/>
|
|
|
|
<antcall target="RoShamBo3"/>
|
|
|
|
<antcall target="RoShamBo4"/>
|
|
|
|
<antcall target="RoShamBo5"/>
|
|
|
|
<antcall target="RoShamBo6"/>
|
|
|
|
<antcall target="SecurityCategory"/>
|
|
|
|
<antcall target="SpaceShip"/>
|
|
|
|
<antcall target="TrafficLight"/>
|
|
|
|
<antcall target="UpcastEnum"/>
|
|
|
|
<antcall target="VendingMachine"/>
|
|
|
|
<antcall target="EnumImplementation"/>
|
|
|
|
<antcall target="Meal"/>
|
|
|
|
<antcall target="Meal2"/>
|
|
|
|
<antcall target="TypeOfFood"/>
|
|
|
|
<antcall target="NotClasses"/>
|
|
|
|
<delete file="failures"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target description="delete all byproducts" name="clean">
|
|
|
|
<delete>
|
|
|
|
<fileset dir="${basedir}" includes="**/*.class"/>
|
|
|
|
<fileset dir="${basedir}" includes="**/*Output.txt"/>
|
|
|
|
<fileset dir="${basedir}" includes="**/log.txt"/>
|
|
|
|
<fileset dir="${basedir}" includes="failures"/>
|
|
|
|
</delete>
|
|
|
|
<echo message="clean successful"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|
|
|
|
|
|
|
|
|