Remaining Ant artifacts removed

This commit is contained in:
Bruce Eckel 2016-07-07 13:24:35 -06:00
parent 04f961cf81
commit fedef37f7b
20 changed files with 1 additions and 542 deletions

View File

@ -1,46 +0,0 @@
<project>
<description>
For this file to be included in all build.xml files
at all directory levels, the single entries with the
"**/" syntax must be used everywhere.
</description>
<target name="clean" description="delete all byproducts" >
<delete>
<fileset dir="${basedir}" casesensitive="yes">
<include name="**/*.class" />
<include name="**/*.txt" />
<include name="**/*.tmp" />
<include name="**/*.xml" />
<include name="**/*.out" />
<include name="**/*.err" />
<include name="**/*.dat" />
<include name="**/*.log" />
<include name="**/*.serialized" />
<include name="**/failures" />
<include name="**/test.gz" />
<include name="**/test.zip" />
<include name="**/X.file" />
<exclude name=".idea/"/>
<exclude name="*.iml"/>
<exclude name="**/*.java"/>
<exclude name="**/Copyright.txt" />
<exclude name="**/Face*.gif"/>
<exclude name="**/build.xml"/>
<exclude name="**/Ant-Common.xml" />
<exclude name="**/Ant-Clean.xml" />
<exclude name="**/run.bat" />
<exclude name="**/*.py" />
<exclude name="**/*.cpp" />
<exclude name="**/VendingMachineInput.txt" />
<exclude name="**/Trash.dat" />
<exclude name="**/Cheese.dat" />
<exclude name="**/log.prop"/>
<exclude name="**/runall.ps1" />
</fileset>
</delete>
<echo message="clean successful"/>
</target>
</project>

View File

@ -1,216 +0,0 @@
<project xmlns:if="ant:if" xmlns:unless="ant:unless">
<property name="chapter" value="CHAPTER?"/>
<property name="antoutput" value="../Ant-output.txt"/>
<description>
Ant build.xml for the source code for chapter ${chapter}
Bruce Eckel On Java
Code available at https://github.com/BruceEckel/OnJava-Examples
See installation instructions in README.md
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>
<!--===========================================================-->
<macrodef name="jrun">
<attribute name="cls" default="NOT SET"/>
<attribute name="dirpath" default=""/>
<attribute name="arguments" default=""/>
<attribute name="failOnError" default="true"/>
<attribute name="timeOut" default="15000"/>
<attribute name="msg" default=""/>
<sequential>
<echo>[${chapter}] java @{cls} @{arguments}&#13;</echo>
<echo file="${antoutput}" append="true">[${chapter}] java @{cls} @{arguments}&#13;</echo>
<java
classname="@{cls}"
classpath="${java.class.path};${basedir};${basedir}/.."
dir="@{dirpath}"
failonerror="@{failOnError}"
fork="true"
timeout="@{timeOut}"
output="${antoutput}" append="true">
<arg line="@{arguments}"/>
<redirector
output="@{cls}.out"
error="@{cls}.err"
createemptyfiles="false"
append="false" />
</java>
<echo file="${antoutput}" append="true">[${chapter}] Finished: java @{cls} @{arguments}&#13;</echo>
<echo file="${antoutput}" append="true">@{msg}&#13;</echo>
<echo file="${antoutput}" append="true">--------------------------------&#13;</echo>
</sequential>
</macrodef>
<!--===========================================================-->
<macrodef name="jrunconsole">
<attribute name="cls" default="NOT SET"/>
<attribute name="dirpath" default=""/>
<attribute name="arguments" default=""/>
<attribute name="failOnError" default="true"/>
<attribute name="timeOut" default="15000"/>
<attribute name="msg" default=""/>
<sequential>
<echo>[${chapter}] java @{cls} @{arguments}&#13;</echo>
<echo append="true">[${chapter}] java @{cls} @{arguments}&#13;</echo>
<java
classname="@{cls}"
classpath="${java.class.path};${basedir};${basedir}/.."
dir="@{dirpath}"
failonerror="@{failOnError}"
fork="true"
timeout="@{timeOut}"
>
<arg line="@{arguments}"/>
</java>
<echo append="true">[${chapter}] Finished: java @{cls} @{arguments}&#13;</echo>
<echo append="true">@{msg}&#13;</echo>
<echo append="true">--------------------------------&#13;</echo>
</sequential>
</macrodef>
<macrodef name="execscript">
<attribute name="name"/>
<sequential>
<condition property="isWindows">
<os family="windows"/>
</condition>
<sequential if:true="isWindows">
<echo message="@{name}.bat"/>
<exec executable="cmd" dir=".">
<arg line="/c @{name}.bat"/>
</exec>
</sequential>
<sequential unless:true="isWindows">
<echo message="@{name}.sh"/>
<exec executable="sh" dir=".">
<arg line="@{name}.sh"/>
</exec>
</sequential>
</sequential>
</macrodef>
<!--===========================================================-->
<target name="base"
description="Build all common dependencies">
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../onjava/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../com/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../polymorphism/music/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../typeinfo/pets/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../collections/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../generics/coffee/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../enums/menu/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
</target>
<!--===========================================================-->
<target name="build"
description="Build all classes in this directory"
depends="base">
<fail message="Java 8 required" unless="version1.8"/>
<echo message="Building '${chapter}'&#13;"/>
<echo file="${antoutput}" append="true" message="Building '${chapter}'&#13;"/>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
debug="true"
excludes="${excludedfiles}"
srcdir="${basedir}">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<echo message="Build '${chapter}' succeeded&#13;"/>
<echo file="${antoutput}" append="true" message="Build '${chapter}' succeeded&#13;"/>
</target>
<!--===========================================================-->
<target name="buildw"
description="Build all classes in this directory, enabling 'Unchecked' warnings"
depends="base">
<fail message="Java 8 required" unless="version1.8"/>
<echo message="Building '${chapter}'&#13;"/>
<echo file="${antoutput}" append="true" message="Building '${chapter}'&#13;"/>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
debug="true"
excludes="${excludedfiles}"
srcdir="${basedir}">
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<echo message="Build '${chapter}' succeeded&#13;"/>
<echo file="${antoutput}" append="true" message="Build '${chapter}' succeeded&#13;"/>
</target>
<!--===========================================================-->
<target name="verifyclean"
description="delete ant verify output files" >
<delete>
<fileset dir="${basedir}" casesensitive="yes">
<include name="**/update_output.bat" />
<include name="**/validate_failures.txt" />
<include name="**/validate_successes.txt" />
<include name="**/strategies.txt" />
<include name="**/edit_errors.bat" />
</fileset>
</delete>
<echo message="verifyclean successful"/>
</target>
<target name="verify"
description="Verify output; requires Python 3.5"
depends="verifyclean">
<exec dir="${basedir}" executable="python" failonerror="true">
<arg line="../verify_output.py" />
</exec>
</target>
</project>

205
build.xml
View File

@ -1,205 +0,0 @@
<?xml version="1.0" ?>
<project basedir="." default="run" name="Bruce Eckel On Java">
<import file="Ant-Clean.xml"/>
<description>
Main build.xml for the source code for
Bruce Eckel On Java
Code available at https://github.com/BruceEckel/OnJava-Examples
See installation instructions in README.md
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>
<filelist id="buildfiles" dir="."
files="objects/build.xml
operators/build.xml
control/build.xml
housekeeping/build.xml
hiding/build.xml
com/build.xml
reuse/build.xml
polymorphism/build.xml
interfaces/build.xml
innerclasses/build.xml
functional/build.xml
collections/build.xml
streams/build.xml
exceptions/build.xml
strings/build.xml
typeinfo/build.xml
generics/build.xml
arrays/build.xml
collectionsindepth/build.xml
files/build.xml
enums/build.xml
annotations/build.xml
threads/build.xml
patterns/build.xml
unittesting/build.xml
assertions/build.xml
references/build.xml
iostreams/build.xml
standardio/build.xml
newio/build.xml
compression/build.xml
serialization/build.xml
preferences/build.xml
network/build.xml
remote/build.xml
logging/build.xml
debugging/build.xml
staticchecking/build.xml
"/>
<filelist id="testablefiles" dir="."
description="All directories that produce auto-testable results"
files="objects/build.xml
operators/build.xml
control/build.xml
housekeeping/build.xml
hiding/build.xml
com/build.xml
reuse/build.xml
polymorphism/build.xml
interfaces/build.xml
innerclasses/build.xml
functional/build.xml
collections/build.xml
streams/build.xml
exceptions/build.xml
strings/build.xml
typeinfo/build.xml
generics/build.xml
arrays/build.xml
collectionsindepth/build.xml
files/build.xml
enums/build.xml
annotations/build.xml
threads/build.xml
patterns/build.xml
unittesting/build.xml
assertions/build.xml
references/build.xml
iostreams/build.xml
standardio/build.xml
newio/build.xml
compression/build.xml
serialization/build.xml
preferences/build.xml
logging/build.xml
debugging/build.xml
staticchecking/build.xml
"/>
<target name="run" description="Compiles and runs all examples">
<delete file="errors.txt"/>
<subant>
<filelist refid="buildfiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="runconsole" description="Continuous Integration version with output">
<delete file="errors.txt"/>
<subant>
<filelist refid="buildfiles"/>
<target name="runconsole" />
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="testable" description="Compiles and runs testable examples">
<delete file="errors.txt"/>
<subant>
<filelist refid="testablefiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="build" description="Compiles all examples">
<fail message="Java 8 required" unless="version1.8"/>
<delete file="errors.txt"/>
<subant target="build">
<filelist refid="buildfiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="finish" if="errors">
<echo message="Errors occurred. See errors.txt for information."/>
</target>
<target name="verifyclean"
description="delete ant verify output files" >
<delete>
<fileset dir="${basedir}" casesensitive="yes">
<include name="update_output.bat" />
<include name="validate_failures.txt" />
<include name="validate_successes.txt" />
<include name="strategies.txt" />
<include name="edit_errors.bat" />
</fileset>
</delete>
<echo message="verifyclean successful"/>
</target>
<target name="verify"
description="Verify output; requires Python 3.5"
depends="verifyclean">
<exec dir="${basedir}" executable="python" failonerror="true">
<arg line="verify_output.py" />
</exec>
</target>
<target name="findbugs" depends="build"
description="Runs findbugs. Must install findbugs from findbugs.sourceforge.net">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"/>
<arg value="-html"/>
<arg value="."/>
<redirector output="findbugs.html"/>
</exec>
</target>
<target name="findbugs-plain" depends="build"
description="Runs findbugs with plain text output">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"/>
<arg value="."/>
<redirector output="findbugs.txt"/>
</exec>
</target>
<target name="findbugs-xml" depends="build"
description="Runs findbugs with xml output">
<exec executable="findbugs.bat">
<arg value="-textui"/>
<arg value="-sortByClass"/>
<arg value="-exclude"/>
<arg value="FindBugsFilter.xml"/>
<arg value="-xml"/>
<arg value="."/>
<redirector output="findbugs.xml"/>
</exec>
</target>
</project>

View File

@ -2,6 +2,7 @@
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// {main: collections.MapOfList}
package collections;
import typeinfo.pets.*;
import java.util.*;

View File

@ -1,3 +0,0 @@
start java ChatterServer
timeout /t 1
java ChatterClient

View File

@ -1,3 +0,0 @@
java -cp ..:. ChatterServer &
sleep 1
java -cp ..:. ChatterClient

View File

@ -1,3 +0,0 @@
start java MultiSimpleServer
timeout /t 1
java MultiSimpleClient

View File

@ -1,3 +0,0 @@
java -cp ..:. MultiSimpleServer &
sleep 1
java -cp ..:. MultiSimpleClient

View File

@ -1,2 +0,0 @@
start java SimpleServer
java SimpleClient

View File

@ -1,3 +0,0 @@
java SimpleServer &
sleep 1
java SimpleClient

View File

@ -1,18 +0,0 @@
<?xml version="1.0" ?>
<project default="run">
<property name="chapter" value="network"/>
<property name="excludedfiles" value=""/>
<import file="../Ant-Common.xml"/>
<import file="../Ant-Clean.xml"/>
<target name="run" description="Compile and run" depends="build">
<jrun cls="LocalHost" />
<jrun cls="WhoAmI" />
<execscript name="SimpleServer"/>
<execscript name="ChatterServer"/>
<execscript name="MultiSimpleServer"/>
</target>
</project>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" ?>
<project default="run">
<property name="chapter" value="remote"/>
<property name="excludedfiles" value=""/>
<import file="../Ant-Common.xml"/>
<import file="../Ant-Clean.xml"/>
<target name="run" description="Compile and run" depends="build">
<execscript name="go"/>
</target>
</project>

View File

@ -1 +0,0 @@
start "ptime.bat" ptime.bat

View File

@ -1 +0,0 @@
sh ptime.sh

View File

@ -1,6 +0,0 @@
start /min "registry.bat" registry.bat 3
start /min "server.bat" server.bat 3
timeout /t 1
java DisplayPerfectTime
timeout /t 3
exit

View File

@ -1,5 +0,0 @@
sh registry.sh 3 &
sleep 1
sh server.sh 3 &
sleep 1
java DisplayPerfectTime

View File

@ -1,4 +0,0 @@
start /min "rmiregistry" rmiregistry
timeout /t %1
taskkill /im rmiregistry.exe
exit

View File

@ -1,3 +0,0 @@
rmiregistry &
sleep $1
killall rmiregistry

View File

@ -1,4 +0,0 @@
start /min "PerfectTimeServer" java PerfectTimeServer
timeout /t %1
taskkill /im java.exe
exit

View File

@ -1,3 +0,0 @@
java PerfectTimeServer &
sleep $1
pkill -f 'java PerfectTimeServer'