📄 build.xml
字号:
<?xml version="1.0"?>
<project name="Thinking in Java (c04)" default="c04.run" basedir=".">
<description>
build.xml for c04 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 c04.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="c04.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="c04.build" depends="JDK.version.check,c04.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="c04.run"/>
</target>
<!-- run all untested examples in this directory -->
<target name="c04.run" depends="c04.build" if="test.run"
description="Compile and run untested examples">
<touch file="failed"/>
<antcall target="ArrayClassObj.run"/>
<antcall target="ArrayInit.run"/>
<antcall target="ArrayNew.run"/>
<antcall target="Arrays.run"/>
<antcall target="DefaultConstructor.run"/>
<antcall target="Demotion.run"/>
<antcall target="ExplicitStatic.run"/>
<antcall target="Flower.run"/>
<antcall target="InitialValues.run"/>
<antcall target="Leaf.run"/>
<antcall target="Mugs.run"/>
<antcall target="MultiDimArray.run"/>
<antcall target="OrderOfInitialization.run"/>
<antcall target="Overloading.run"/>
<antcall target="OverloadingOrder.run"/>
<antcall target="PrimitiveOverloading.run"/>
<antcall target="SimpleConstructor.run"/>
<antcall target="SimpleConstructor2.run"/>
<antcall target="StaticInitialization.run"/>
<antcall target="TerminationCondition.run"/>
<antcall target="VarArgs.run"/>
<delete file="failed"/>
</target>
<target name="ArrayClassObj.run">
<java
taskname="ArrayClassObj"
classname="ArrayClassObj"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="ArrayInit.run">
<java
taskname="ArrayInit"
classname="ArrayInit"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="ArrayNew.run">
<java
taskname="ArrayNew"
classname="ArrayNew"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="Arrays.run">
<java
taskname="Arrays"
classname="Arrays"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="DefaultConstructor.run">
<java
taskname="DefaultConstructor"
classname="DefaultConstructor"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="Demotion.run">
<java
taskname="Demotion"
classname="Demotion"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="ExplicitStatic.run">
<java
taskname="ExplicitStatic"
classname="ExplicitStatic"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="Flower.run">
<java
taskname="Flower"
classname="Flower"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="InitialValues.run">
<java
taskname="InitialValues"
classname="InitialValues"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="Leaf.run">
<java
taskname="Leaf"
classname="Leaf"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="Mugs.run">
<java
taskname="Mugs"
classname="Mugs"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="MultiDimArray.run">
<java
taskname="MultiDimArray"
classname="MultiDimArray"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="OrderOfInitialization.run">
<java
taskname="OrderOfInitialization"
classname="OrderOfInitialization"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="Overloading.run">
<java
taskname="Overloading"
classname="Overloading"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="OverloadingOrder.run">
<java
taskname="OverloadingOrder"
classname="OverloadingOrder"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="PrimitiveOverloading.run">
<java
taskname="PrimitiveOverloading"
classname="PrimitiveOverloading"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="SimpleConstructor.run">
<java
taskname="SimpleConstructor"
classname="SimpleConstructor"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="SimpleConstructor2.run">
<java
taskname="SimpleConstructor2"
classname="SimpleConstructor2"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="StaticInitialization.run">
<java
taskname="StaticInitialization"
classname="StaticInitialization"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="TerminationCondition.run">
<java
taskname="TerminationCondition"
classname="TerminationCondition"
classpath="${basedir};${basedir}/.."
dir="../c04"
fork="true"
failonerror="true"
/>
</target>
<target name="VarArgs.run">
<java
taskname="VarArgs"
classname="VarArgs"
classpath="${basedir};${basedir}/.."
dir="../c04"
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="c04"
destdir="${basedir}/../jcsc"
worstcount="20">
<fileset dir="${basedir}" includes="**/*.java"/>
</jcsc>
</target>
</project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -