⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 build.xml

📁 thinking in patterns
💻 XML
字号:
<?xml version="1.0"?>

<project name="Thinking in Java (templatemethod)" default="templatemethod.run" basedir=".">

  <description>
  build.xml for templatemethod 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 templatemethod.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="templatemethod.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>
  </target>

  <!-- build all classes in this directory -->
  <target name="templatemethod.build" depends="JDK.version.check,templatemethod.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="templatemethod.run"/>
  </target>

  <!-- run all untested examples in this directory -->
  <target name="templatemethod.run" depends="templatemethod.build" if="test.run"
    description="Compile and run untested examples">
    <touch file="failed"/>
    <antcall target="TemplateMethod.run"/>
    <delete file="failed"/>
  </target>
  
  <target name="TemplateMethod.run">
    <java
      taskname="TemplateMethod"
      classname="templatemethod.TemplateMethod"
      classpath="${basedir}/.."
      fork="true" 
      failonerror="true"
    />
  </target>

  <!-- delete all class files, javadocs, and other byproducts -->
  <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="templatemethod"
      destdir="${basedir}/../jcsc"
      worstcount="20">
      <fileset dir="${basedir}" includes="**/*.java"/>
    </jcsc>
  </target>
  
</project>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -