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

📄 build.xml

📁 j2me软件教学
💻 XML
字号:
<?xml version="1.0"?>


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

  <description>
  build.xml for c07 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 c07.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="c07.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="c07.build" depends="JDK.version.check,c07.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="c07.run"/>
  </target>

  <!-- run all untested examples in this directory -->
  <target name="c07.run" depends="c07.build" if="test.run"
    description="Compile and run untested examples">
    <touch file="failed"/>
    <antcall target="Frog.run"/>
    <antcall target="PolyConstructors.run"/>
    <antcall target="PrivateOverride.run"/>
    <antcall target="RTTI.run"/>
    <antcall target="Sandwich.run"/>
    <antcall target="Shapes.run"/>
    <antcall target="Transmogrify.run"/>
    <antcall target="Music.run"/>
    <antcall target="Music2.run"/>
    <antcall target="Music3.run"/>
    <antcall target="Music4.run"/>
    <delete file="failed"/>
  </target>

  <target name="Frog.run">
    <java
      taskname="Frog"
      classname="Frog"
      classpath="${basedir};${basedir}/.."
      dir="../c07"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="PolyConstructors.run">
    <java
      taskname="PolyConstructors"
      classname="PolyConstructors"
      classpath="${basedir};${basedir}/.."
      dir="../c07"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="PrivateOverride.run">
    <java
      taskname="PrivateOverride"
      classname="PrivateOverride"
      classpath="${basedir};${basedir}/.."
      dir="../c07"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="RTTI.run">
    <java
      taskname="RTTI"
      classname="RTTI"
      classpath="${basedir};${basedir}/.."
      dir="../c07"
      fork="true"
      failonerror="false"
    />
    <echo message="* Exception was expected *"/>
  </target>

  <target name="Sandwich.run">
    <java
      taskname="Sandwich"
      classname="c07.Sandwich"
      classpath="${basedir}/.."
      dir="../c07"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="Shapes.run">
    <java
      taskname="Shapes"
      classname="Shapes"
      classpath="${basedir};${basedir}/.."
      dir="../c07"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="Transmogrify.run">
    <java
      taskname="Transmogrify"
      classname="Transmogrify"
      classpath="${basedir};${basedir}/.."
      dir="../c07"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="Music.run">
    <java
      taskname="Music"
      classname="c07.music.Music"
      classpath="${basedir}/.."
      dir="../c07/music"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="Music2.run">
    <java
      taskname="Music2"
      classname="c07.music.Music2"
      classpath="${basedir}/.."
      dir="../c07/music"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="Music3.run">
    <java
      taskname="Music3"
      classname="c07.music3.Music3"
      classpath="${basedir}/.."
      dir="../c07/music3"
      fork="true"
      failonerror="true"
    />
  </target>

  <target name="Music4.run">
    <java
      taskname="Music4"
      classname="c07.music4.Music4"
      classpath="${basedir}/.."
      dir="../c07/music4"
      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="c07"
      destdir="${basedir}/../jcsc"
      worstcount="20">
      <fileset dir="${basedir}" includes="**/*.java"/>
    </jcsc>
  </target>
</project>

⌨️ 快捷键说明

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