📄 build.xml
字号:
<?xml version="1.0"?>
<project name="Thinking in Java (c05)" default="c05.run" basedir=".">
<description>
build.xml for c05 of "Thinking in Java, 3rd Edition"
by Bruce Eckel
Available at http://www.MindView.net
See copyright notice in CopyRight.txt
Ant must be downloaded from:
http://jakarta.apache.org/ant
Options:
ant
compiles and runs all examples (if necessary)
ant test
compiles and runs all examples
ant c05.build
compiles but does not run examples
ant clean
removes old class files
</description>
<target name="JDK.version.check" unless="JDK.version.ok">
<javac
includes="CheckVersion.java"
srcdir="${basedir}/../com/bruceeckel/tools/"
classpath="${basedir}/.."
/>
<java
taskname="CheckVersion"
classname="com.bruceeckel.tools.CheckVersion"
classpath="${basedir}/.."
fork="true"
failonerror="true"
/>
<property name="JDK.version.ok" value="true"/>
</target>
<!-- build all dependencies and check to see if tests are up to date -->
<target name="c05.prepare">
<condition property="test.run" value="true">
<or>
<uptodate>
<srcfiles dir= "${basedir}" includes="**/*Output.txt"/>
<mapper type="glob" from="*Output.txt" to="*.class"/>
</uptodate>
<available file="failed"/>
</or>
</condition>
<ant
antfile="${basedir}/../com/build.xml"
target="com.build"
dir="${basedir}/../com"
output="${basedir}/../com/log.txt"
/>
</target>
<!-- build all classes in this directory -->
<target name="c05.build" depends="JDK.version.check,c05.prepare"
description="Compile all source files">
<javac
srcdir="${basedir}"
classpath="${basedir}/.."
source="1.4"
/>
</target>
<!-- force all tests to be run -->
<target name="test" description="Compile and test all examples">
<property name="test.run" value="true"/>
<antcall target="c05.run"/>
</target>
<!-- run all untested examples in this directory -->
<target name="c05.run" depends="c05.build" if="test.run"
description="Compile and run untested examples">
<touch file="failed"/>
<antcall target="Cake.run"/>
<antcall target="ChocolateChip.run"/>
<antcall target="Dinner.run"/>
<antcall target="IceCream.run"/>
<antcall target="LibTest.run"/>
<antcall target="TestAssert.run"/>
<antcall target="ToolTest.run"/>
<delete file="failed"/>
</target>
<target name="Cake.run">
<java
taskname="Cake"
classname="Cake"
classpath="${basedir};${basedir}/.."
dir="../c05"
fork="true"
failonerror="true"
/>
</target>
<target name="ChocolateChip.run">
<java
taskname="ChocolateChip"
classname="ChocolateChip"
classpath="${basedir};${basedir}/.."
dir="../c05"
fork="true"
failonerror="true"
/>
</target>
<target name="Dinner.run">
<java
taskname="Dinner"
classname="Dinner"
classpath="${basedir};${basedir}/.."
dir="../c05"
fork="true"
failonerror="true"
/>
</target>
<target name="IceCream.run">
<java
taskname="IceCream"
classname="IceCream"
classpath="${basedir};${basedir}/.."
dir="../c05"
fork="true"
failonerror="true"
/>
</target>
<target name="LibTest.run">
<java
taskname="LibTest"
classname="LibTest"
classpath="${basedir};${basedir}/.."
dir="../c05"
fork="true"
failonerror="true"
/>
</target>
<target name="TestAssert.run">
<java
taskname="TestAssert"
classname="TestAssert"
classpath="${basedir};${basedir}/.."
dir="../c05"
fork="true"
failonerror="true"
/>
</target>
<target name="ToolTest.run">
<java
taskname="ToolTest"
classname="ToolTest"
classpath="${basedir};${basedir}/.."
dir="../c05"
fork="true"
failonerror="true"
/>
</target>
<!-- delete all class files -->
<target name="clean" description="Removes all old class files">
<delete>
<fileset dir="${basedir}" includes="**/*.class"/>
<fileset dir="${basedir}" includes="**/*Output.txt"/>
<fileset dir="${basedir}" includes="**/log.txt"/>
<fileset dir="${basedir}" includes="failed"/>
</delete>
<echo message="clean successful"/>
</target>
<target name="jcsc">
<taskdef name="jcsc" classname="rj.tools.jcsc.ant.JCSCTask"/>
<jcsc rules="${basedir}/../tij.jcsc"
startpackage="c05"
destdir="${basedir}/../jcsc"
worstcount="20">
<fileset dir="${basedir}" includes="**/*.java"/>
</jcsc>
</target>
</project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -