Ant との統合/Ant Integration

Last update : July 6 2002
Doc for : v1.3

Cactusについて
  • Cactus とは
  • ニュース
  • 変更履歴
  • 特徴/開発状況
  • 目標
  • ロードマップ/ToDo
  • 協力者
  • 協力者募集
  • Cactus ユーザ
  • テスト済環境 ...
  • ライセンス


  • ダウンロード
  • ダウンロード


  • ドキュメント
  • Cactus の仕組み
  • さぁ始めよう
  • モック対コンテナ
  • Javadocs
  • └Javadocs
  • よくある質問


  • Howto ガイド
  • クラスパス Howto
  • 設定 Howto
  • アップグレードHowto
  • テストケース Howto
  • セキュリティHowto
  • Ant Howto
  • HttpUnit Howto
  • サンプル Howto
  • EJB Howto
  • IDE Howto
  • JUnitEE Howto


  • サポート
  • Bug DB
  • メーリングリスト


  • その他
  • 名前の由来
  • ロゴコンテスト
  • 参考文献
  • アクセス状況
  • └WebAlizer


  • 開発者向け
  • CVS
  • コード規約
  • ビルドの結果


  • 継続的インテグレーション/Continuous integration

    Note This tutorial was written when I wrote Cactus 1.2. Since then I have improved my command of Ant. However this tutorial has not yet been updated. I believe it still provides some very good methodology on how to use Ant, although not the latest. If you wish to keep track of the latest change, have a look at the Cactus build files, found in the source distribution.

    Note 本チュートリアルは Cactus 1.2 を作成した時に書かれたもので、 作者の Ant コマンドは更新されています。 しかしながら、このチュートリアルは、まだ更新されていません。 これは、最新のものではありませんが、 Ant の使用法についての良い方法論を与え続けられると信じています。 最新の更新について調べたい場合には、 配布されたソースにある Cactus ビルドファイルを参照してください。

    A strong principle of eXtreme Programming (XP) is the continuous integration aspect (see the Continuous Integration article by Martin Fowler). The traditional approach has been to developing the code first, then test it and then integrate it with other appications. The continuous integration principle is to develop code, tests and integrate at the same time, i.e. at any point in time, you have a functioning code along with tests and integrated.

    エクストリームプログラミング(XP)の強力な原理は、 継続的インテグレーションの一側面です。 (Martin Fowler 氏の論文 継続的インテグレーションを参照してください。) 古典的な開発のアプローチでは、 まず最初にコーディングし、テストし、他のアプリケーションと統合するというものでした。 継続的インテグレーションの原理では、 コーディング、テスト、統合を同時に行います。 即ち、開発者はどの時点でもテストされ、 統合された、動作するプログラムコードを持っているのです。

    In order to be able to do continuous integration, you need to be able to automatically run the build for your application, including passing the unit tests (based on JUnit, Cactus, HttpUnit or others). Ant is the perfect tool for this task.

    継続的インテグレーションを行うためには、 (JUnit、Cactus、HttpUnit、他、に基づき) 単体テストを通すことを含めて、 自動的にアプリケーションをビルドできなければなりません。 Ant はこのような作業を行うための完璧なツールなのです。


    Ant のメリット/Ant benefits

    The benefits of using Ant for running unit tests are as follows :

    単体テストを行うために Ant を使う利点は次の通りです :

    メリット/Benefits  
    Ant is written in Java and thus the same scripts can be used on several systems (Windows and Unix for example). Is is therefore very well suited for building java applications.  
    Ant は Java により記述されているので、 同じスクリプトが複数のシステムで利用可能です。 (例えば、Windows 及び Unix) 従って、Java アプリケーションを開発するのに、最適です。  
    Ant provides enough built-in and optional tasks to be able to achieve almost any needed build task without needing to use system dependent scripts.  
    Ant では、 システム依存のスクリプトを使わずに、 ビルドで必要な、ほぼ全ての事を達成できるように、 充分な組み込みそしてオプションのタスクが提供されています。  
    By being able to very quickly rerun unit test you can verify that your tests still pass when you modify some part of your code ( regression testing)  
    単体テストを迅速に再実行できるので、 コードを一部変更した時でも、テストに合格するか確認できます。(回帰テスト)  
    As it is automated, it fits well in the continuous integration principle and your tests can thus be ran automatically and continously  
    自動化されているので、継続的インテグレーションの原理にとてもよくマッチし、 テストを自動的に、かつ、継続的に実行できます。  

    Ant ビルドファイル作成のチュートリアル/Writing an Ant build script tutorial

    The sample Ant build file described below is taken from the Cactus Sample for Servlet API 2.2 project.

    下に示すAnt のサンプルビルドファイルは Servlet API 2.2 用 Cactus サンプル のプロジェクトにあるものです。

    Note This section is both a tutorial for automating builds and unit testing with Ant and Cactus and also a best practice and methodology guide for using Ant in general (independent of Cactus). This is an Ant configuration that has been working for me on several project. Of course, you are free to adapt/modify it to suit your needs.

    Note 本節では、 Ant と Cactus によるビルドと単体テストの自動化のためのチュートリアル、 そして、Antを使った一般的な最高の練習と方法論(これは Cactus に無関係です)について説明します。 これは、筆者の幾つかのプロジェクトで動いていた Ant の設定です。 もちろん、必要に応じて自由に変更して構いません。

    プロジェクトのディレクトリ構造/Project directory structure

    Create the following directories :

    次のディレクトリを作成します :

    Directory name   Content of the directory  
    build   The Ant build file and some other ancillary files (properties file, ...)  
    conf   Configuration files for the project. These are the configuration files that will not be put into the runtime jar. They are configuration file that need to be visible and modifyable by a user of the project. If they were bundled in the jar they would be hard to modify. On the other hand, we don't want a proliferation of configuration files, so all technical configuration files (messages to display for errors, ...) should be put in the src directory in correct java packages.  
    conf/test   Configuration files needed for testing the project only.  
    docs   Project documentation.  
    docs/skins   Documentation skin for Stylebook (if using Stylebook).  
    docs/xdocs   Documentation files (XML files) for Stylebook (if using Stylebook).  
    src   The project sources : java files + java test files + properties files + test properties files + other files for runtime or test (XML files, ...). Note that all test files should begin by 'Test' or 'test' in order to easily separate them from other files so that in an Ant target we'll be able to include only the runtime files.  
    web   The project web files : HTML, JSP, ... (if any)  
    ディレクトリ名   ディレクトリの内容  
    build   Antビルドファイル、および補助ファイル(プロパティファイル、など)  
    conf   プロジェクトの設定ファイル。 これらは、ランタイムの jar ファイルに置かれない設定ファイルです。 これらは、プロジェクトのユーザーにより、 参照および編集が必要な設定ファイルです。 もし、これが jar ファイルの中に置かれていたなら、 変更は難しかったでしょう。 一方で、 設定ファイルを増殖させたくはないので、 全ての技術的な設定ファイル (エラーで表示されるメッセージなど、、)は 正しい java パッケージのsrc ディレクトリに置くべきです。  
    conf/test   プロジェクトのテストにのみ必要な設定ファイル  
    docs   プロジェクトのドキュメント  
    docs/skins   (stylebookを使う場合)stylebook用のドキュメントテンプレート  
    docs/xdocs   (stylebookを使う場合)stylebook用のドキュメントファイル(XMLファイル)  
    src   プロジェクトのソース : java ファイル + java テストファイル + プロパティファイル + テストプロパティファイル + ランタイムやテスト用の他のファイル(XMLファイル等)。 Ant ターゲットにおいてランタイムファイルのみを含められるよう、 簡単にこれらを他のファイルと区別するために、 全てのテストファイル名は 'Test' あるいは 'test' で始らなくてはなりません。  
    web   (もしあれば)プロジェクトのウェブファイル : HTML,JSP...  

    Note In the sample application provided with Cactus, we don't generate any web site documentation (only javadoc) so we're not using the stylebook-related directories and Ant targets. However we do so in Cactus itself, so if you need to take a look, download the Cactus sources.

    Note Cactus で提供されるサンプルアプリケーションにおいて、 (javadoc 以外は)ウェブサイトのドキュメントを生成しないので、 stylebook に関するディレクトリおよびAntのターゲットは使っていません。 しかしながら、Cactus 自身においては、ウェブサイトドキュメントを生成しています。 見たい場合には、Cactus のソースをダウンロードしてください。

    Note An out directory will be created by the Ant build. All build-generated files will be put in that directory (compiled classes, generated javadoc documentation, test configuration files for running an application server, ...).

    Note outディレクトリはAntのビルドにより生成されます。 ビルドが生成した全てのファイルはこのディレクトリに置かれます。 (コンパイルされたクラス、生成された javadoc ドキュメント, アプリケーションサーバーを実行するためのテスト設定ファイル、等)

    Note We don't have any lib directory because it is always better not to include dependent jars in your project whenever possible for the following reasons : better continuous integration with other libraries (meaning they also evolve and you should test as much as possible with the latest version to discover potential problems early, more lightweight downloads, less jar proliferation (you'll end up with tens of the same jars otherwise), more version control and integration checks (if your project uses 2 external libraries that need another third library but not in the same version you are in trouble !), ...

    Note 我々はlibディレクトリを使いたくありません。 なぜなら、可能ならば次に示す理由により、 プロジェクトに依存関係のある jar ファイルをインクルードしない方が必ず良いからです : それは、 他のライブラリとの継続的インテグレーションがやりやすいという事です。 (これにより、進化し、 問題発生の可能性を早く見つけるために、 最新のバージョンでできる限り多くテストし、 ダウンロードを軽量化し、 jar ファイルの増殖を防ぎ、 (さもないと、同じ 10 個の jar を持つことになります。) バージョンコントロールおよび結合テストが数多くできます。 (もし、同じバージョンでないような、 別の第3のライブラリを必要とする 2 つの外部ライブラリをプロジェクトで使っているとしたら、 トラブルに巻き込まれるでしょう)、、、


    Ant のターゲットの一覧/Ant Target List

    Define the following targets in your build.xml.

    build.xmlにおいて次のターゲットを定義してください

    Note The Type column specify whether the target is an external target that can be called by the user of the build file or if it is an internal target, intended to be called internally by another target inside the build script.

    Note 種類の列は、 ビルドファイルのユーザーにより呼び出され得る外部ターゲットか、 ビルドファイル内の別のターゲットにより内部的に呼び出されるはずのターゲットかを示しています。

    Target name   Description   Type  
    init   Defines token filters, timestamp, display some information on screen, ...   Internal  
    usage   Display usage information about the targets.   External  
    prepare   Set up the output directory where build generated files will be put and copy the java sources to this output directory, replacing tokens with the values defined in the init target.   Internal  
    compile   Compile the java sources and put the result in the output directory. All copies non java source files such as .properties files, XML configuration files, ...   Internal  
    source   Generate a zipped file containing the full sources of the project (i.e. the whole directory structure, excluding any build generated files).   External  
    javadoc   Generates the javadoc of the project. This javadoc will be part of the project documentation, as generated by the doc target.   Internal  
    doc   Generates the full project documentation : javadoc + README files + documentation web site (using Stylebook for example).   External  
    clean   Remove any build generated files. In particular, delete the output directory.   External  
    jar, war, ear, ...   Generate the project runtime. If the project is a framework, it is usually a jar. If the project is a web application, it is usually a war file. If the project is an EJB application, it is usually either one or several jars or an ear file. Etc ...   External  
    tests_XXX where XXX is the name of the servlet engine on which the tests run.   Run the Cactus unit tests.   External  
    ターゲット名   説明   種類  
    init   トークンフィルター、タイムスタンプを定義し、 スクリーン上に何らかの情報を表示します、、、   内部  
    usage   ターゲットに関する使用法の情報を表示します   外部  
    prepare   出力先ディレクトリを設定します。 このディレクトリに、 ビルドにより生成されたファイルが置かれ、 initターゲットにおいて定義された値により、 トークンを置換して、この出力ディレクトリに java のソースをコピーします。   内部  
    compile   java ソースをコンパイルし、結果を出力先ディレクトリに置きます。 .properties ファイルや、 XML 設定ファイルといった全てのファイルをコピーします。   内部  
    source   プロジェクトの全てのソースを含んだ ZIP アーカイブを生成します。 (即ち、ビルドにより生成されたファイルを除いた、 ディレクトリ構造全体です。)   外部  
    javadoc   プロジェクトの javadoc を生成します。 docターゲットに生成されたように、 この javadoc はプロジェクトドキュメントの一部です。   内部  
    doc   プロジェクトドキュメント全体を生成します : javadoc + README ファイル + (例えば stylebook を使った)ウェブサイトのドキュメント   外部  
    clean   ビルドにより生成されたファイルを全て削除します。 特に output ディレクトリを削除します。   外部  
    jar, war, ear, ...   プロジェクトのランタイムを生成します。 プロジェクトがフレームワークの場合、通常 jar が、 ウェブアプリケーションの場合、通常 war が、 EJB アプリケーションの場合、通常、 一つかそれ以上の jar か、あるいは、 一つの ear ファイルが生成されます。   外部  
    tests_XXX ここで XXX はテストを実行するサーブレットエンジンの名前です。   Cactus 単体テストを実行します   外部  

    ステップ 1 : Ant のプロジェクトの basedir/Step 1 : The Ant project basedir

    You build.xml file being in located in build/ you should set the project tag basedir attribute to '..' so that all other paths are relative to your project root directory. Indeed, the batch file (shell script) that was used to bootstrap Ant is located in <root>/build, so '..' is the root directory.

    他の全てのパスがプロジェクトのルートディレクトリから相対的になるように、 build/ディレクトリにあるbuild.xmlファイルにおいて、 projectタグ中のbasedir属性を '..' に設定しなければなりません。 実際に、 '..' がルートディレクトリなので、 Ant を起動するのに使われるバッチファイル(シェルスクリプト)は <root>/build にあります。

    Example :

    例 :

    <?xml version="1.0"?>
    [...]
    <project name="Cactus Sample" default="war" basedir="..">
    

    ステップ 2 : プロジェクトプロパティの初期化/Step 2 : initialization of project properties

    You should define as properties all values that can be factorized and which are used often in your build file such as source locations, output locations, external jar locations and names, ... You can also define useful file patterns there (see the sample below).

    ソースの場所、出力先、外部 jar の位置や名前など、 要素に分解できて、ビルドファイル中で頻繁に使われる値はプロパティとして定義すべきです。 そこでは便利なファイルパターンも定義できます。 (下を参照してください)

    A good principle is to defined any properties that depend on your environment (such as external jar locations) in a file (let's call it build.properties located either where build.xml is located or in your home directory. The properties defined in this file will be loaded by build.xml using the following code :

    プロパティを定義する良い原則は、 (外部 jar の場所など)自分の環境に依存するどんなプロパティでも、 一つのファイル中に定義することです。 (build.xml ファイルがある場所や、 ホームディレクトリにあったとしても、 これをbuild.propertiesと呼ぶことにします。) このファイルで定義されたプロパティは次のような文を使って、 build.xmlに読み込まれます。

        <!-- Give user a chance to override without editing this file
             (and without typing -D each time it compiles it) -->
        <property file="build/build.properties" />
        <property file="${user.home}/build.properties" />
    
        <!-- ユーザにこのファイルを編集せずに
    	(さらにコンパイルするたびに -D と打たずに)
    	設定を上書きするチャンスを与えます -->
        <property file="build/build.properties" />
        <property file="${user.home}/build.properties" />
    

    Here are our properties initializations :

    以下にプロパティの初期化を示します :

    <project name="Cactus Sample" default="war" basedir="..">
    
        <!-- Give user a chance to override without editing this file
             (and without typing -D each time it compiles it) -->
        <property file="build/build.properties" />
        <property file="${user.home}/build.properties" />
    
        <!-- Generic project properties -->
        <property name="project.fullname" value="Cactus Sample"/>
        <property name="project.version" value="1.3"/>
        <property name="project.name" value="cactus-sample"/>
    
        <!-- Miscellaneous settings -->
        <property name="year" value="2000-2002"/>
        <property name="debug" value="on"/>
        <property name="optimize" value="off"/>
        <property name="deprecation" value="off"/>
    
        <!--
           ========================================================================
             Set the properties related to the source tree
           ========================================================================
        -->
        <!-- Source locations for the build -->
        <property name="src.dir" value="src"/>
        <property name="src.java.dir" value="${src.dir}/share"/>
        <property name="src.java.servlet.dir" value="${src.dir}/servlet@servlet.api@"/>
        <property name="build.dir" value="build"/>
        <property name="etc.dir" value="${build.dir}/etc"/>
        <property name="lib.dir" value="lib"/>
        <property name="conf.dir" value="conf"/>
        <property name="conf.test.dir" value="conf/test"/>
        <property name="web.dir" value="web"/>
    
        <!--
           ========================================================================
             Set the properties related to the build area
           ========================================================================
        -->
        <!-- Destination locations for the build (relative to the basedir as -->
        <!-- specified in the basedir attribute of the project tag)          -->
        <property name="out.dir" value="out"/>
        <property name="out.dist.dir" value="${out.dir}/dist"/>
        <property name="out.lib.dir" value="${out.dir}/lib"/>
        <property name="out.test.dir" value="${out.dir}/test"/>
        <property name="out.src.dir" value="${out.dir}/src"/>
        <property name="out.classes.dir" value="${out.dir}/classes"/>
        <property name="out.doc.dir" value="${out.dir}/doc"/>
        <property name="out.javadoc.dir" value="${out.doc.dir}/javadoc"/>
        <property name="out.conf.dir" value="${out.dir}/conf"/>
    
        <!-- Names of deliverables -->
    
        <!-- The Cactus Sample war file. This is the file that should be
             used at runtime by end users (it excludes the test classes) -->
        <property name="final.war.name" value="${out.dir}/${project.name}-@servlet.api@.war"/>
    
        <!-- The full sources of Cactus Sample in a zip file -->
        <property name="final.src.name" value="${out.dir}/${project.name}-src-@servlet.api@.zip"/>
    
        <!-- The Cactus Sample documentation in a zip : javadoc -->
        <property name="final.doc.name" value="${out.dir}/${project.name}-doc-@servlet.api@.zip"/>
    
        <!--
           ========================================================================
             Useful file patterns for targets
           ========================================================================
        -->
        <!-- All source files of the projet. These source files will be copied
             to the destination source directory in the prepare task -->
        <patternset id="all.src.files">
    
            <!-- All java files -->
            <include name="**/*.java"/>
    
            <!-- All doc files -->
            <include name="**/package.html"/>
            <include name="**/overview.html"/>
    
            <!-- All conf files (including test files) -->
            <include name="**/*.txt"/>
            <include name="**/*.xml"/>
            <include name="**/*.properties"/>
    
        </patternset>
    
        <!-- All non java files in the src directory -->
        <patternset id="all.nonjava.files">
    
            <!-- All conf files (including test files) -->
            <include name="**/*.txt"/>
            <include name="**/*.xml"/>
            <include name="**/*.properties"/>
    
        </patternset>
    
    <project name="Cactus Sample" default="war" basedir="..">
    
        <!-- ユーザにこのファイルを編集せずに
    	(さらにコンパイルするたびに -D と打たずに)
    	設定を上書きするチャンスを与えます -->
        <property file="build/build.properties" />
        <property file="${user.home}/build.properties" />
    
        <!-- 一般的なプロジェクトのプロパティ -->
        <property name="project.fullname" value="Cactus Sample"/>
        <property name="project.version" value="1.3"/>
        <property name="project.name" value="cactus-sample"/>
    
        <!-- 種々の設定 -->
        <property name="year" value="2000-2002"/>
        <property name="debug" value="on"/>
        <property name="optimize" value="off"/>
        <property name="deprecation" value="off"/>
    
        <!--
           ========================================================================
             ソースツリーに関する設定
           ========================================================================
        -->
        <!-- ビルドのためのソースの場所 -->
        <property name="src.dir" value="src"/>
        <property name="src.java.dir" value="${src.dir}/share"/>
        <property name="src.java.servlet.dir" value="${src.dir}/servlet@servlet.api@"/>
        <property name="build.dir" value="build"/>
        <property name="etc.dir" value="${build.dir}/etc"/>
        <property name="lib.dir" value="lib"/>
        <property name="conf.dir" value="conf"/>
        <property name="conf.test.dir" value="conf/test"/>
        <property name="web.dir" value="web"/>
    
        <!--
           ========================================================================
             ビルドエリアに関するプロパティ
           ========================================================================
        -->
        <!-- ビルドのための出力先 (プロジェクトタグの basedir 属性で -->
        <!-- 指定される basedir に関するもの) -->
        <property name="out.dir" value="out"/>
        <property name="out.dist.dir" value="${out.dir}/dist"/>
        <property name="out.lib.dir" value="${out.dir}/lib"/>
        <property name="out.test.dir" value="${out.dir}/test"/>
        <property name="out.src.dir" value="${out.dir}/src"/>
        <property name="out.classes.dir" value="${out.dir}/classes"/>
        <property name="out.doc.dir" value="${out.dir}/doc"/>
        <property name="out.javadoc.dir" value="${out.doc.dir}/javadoc"/>
        <property name="out.conf.dir" value="${out.dir}/conf"/>
    
        <!-- 配布物の名称 -->
    
        <!-- Cactus サンプル war ファイル。これは、エンドユーザーにより -->
        <!-- 実行時に使われるファイルです。(テストクラスは除きます) -->
        <property name="final.war.name" value="${out.dir}/${project.name}-@servlet.api@.war"/>
    
        <!-- ZIP化したCactusサンプルの全ソース -->
        <property name="final.src.name" value="${out.dir}/${project.name}-src-@servlet.api@.zip"/>
    
        <!-- ZIP化したCactusサンプルドキュメント : javadoc -->
        <property name="final.doc.name" value="${out.dir}/${project.name}-doc-@servlet.api@.zip"/>
    
        <!--
           ========================================================================
             ターゲット用の便利なファイルパターン
           ========================================================================
        -->
        <!-- プロジェクトの全ソースファイル。これらのソースファイルは、
    	準備タスクにおいて出力ソースディレクトリにコピーされます。-->
        <patternset id="all.src.files">
    
            <!-- 全 java ファイル -->
            <include name="**/*.java"/>
    
            <!-- 全 doc ファイル -->
            <include name="**/package.html"/>
            <include name="**/overview.html"/>
    
            <!-- 全 conf ファイル (テストファイルを含む) -->
            <include name="**/*.txt"/>
            <include name="**/*.xml"/>
            <include name="**/*.properties"/>
    
        </patternset>
    
        <!-- srcディレクトリにある全ての java でないファイル -->
        <patternset id="all.nonjava.files">
    
            <!-- 全 conf ファイル (テストファイルを含む) -->
            <include name="**/*.txt"/>
            <include name="**/*.xml"/>
            <include name="**/*.properties"/>
    
        </patternset>
    

    ステップ 3 : 'init' ターゲット/Step 3 : 'init' target

    Useful for initializing a timestamp (DSTAMP, TODAY, TSTAMP), defining token filters, printing some information messages, registering custom Ant tasks, ...

    タイムスタンプ(DSTAMP,TODAY,TSTAMP)を初期化したり、 トークンフィルターを定義したり、メッセージ情報を出力したり、 カスタム Ant タスクを登録したり、等に便利です。

        <!--
           ========================================================================
             Initialize the build. Must be called by all targets
           ========================================================================
        -->
        <target name="init">
    
            <!-- So that we can use the ${TSTAMP}, ${DSTAMP}, ... time stamps
                 in targets, if need be -->
            <tstamp/>
    
            <echo message="--------- ${project.fullname} ${project.version} ---------"/>
            <echo message=""/>
    
            <echo message="java.class.path = ${java.class.path}"/>
            <echo message=""/>
            <echo message="java.home = ${java.home}"/>
            <echo message="user.home = ${user.home}"/>
            <echo message=""/>
            <echo message="basedir = ${basedir}"/>
            <echo message=""/>
            <echo message="servlet.jar = ${servlet.jar}"/>
            <echo message="cactus.jar = ${cactus.jar}"/>
            <echo message="junit.jar = ${junit.jar}"/>
            <echo message="cactus.ant.jar = ${cactus.ant.jar}"/>
    
            <!-- Filters -->
            <filter token="version" value="${project.version}"/>
            <filter token="year" value="${year}"/>
    
            <!-- Initialize custom Ant task needed for running the server tests -->
            <taskdef name="runservertests" classname="org.apache.cactus.ant.RunServerTestsTask">
                <classpath>
                    <pathelement location="${cactus.ant.jar}"/>
                    <pathelement path="${java.class.path}"/>
                </classpath>
            </taskdef>
    
        </target>
    
        <!--
           ========================================================================
             ビルドの初期化をします。全てのターゲットにより呼び出されます。
           ========================================================================
        -->
        <target name="init">
    
            <!-- 必要であれば、${TSTAMP}, ${DSTAMP} 等、
    		タイムスタンプを使えるよう -->
            <tstamp/>
    
            <echo message="--------- ${project.fullname} ${project.version} ---------"/>
            <echo message=""/>
    
            <echo message="java.class.path = ${java.class.path}"/>
            <echo message=""/>
            <echo message="java.home = ${java.home}"/>
            <echo message="user.home = ${user.home}"/>
            <echo message=""/>
            <echo message="basedir = ${basedir}"/>
            <echo message=""/>
            <echo message="servlet.jar = ${servlet.jar}"/>
            <echo message="cactus.jar = ${cactus.jar}"/>
            <echo message="junit.jar = ${junit.jar}"/>
            <echo message="cactus.ant.jar = ${cactus.ant.jar}"/>
    
            <!-- フィルタ -->
            <filter token="version" value="${project.version}"/>
            <filter token="year" value="${year}"/>
    
            <!-- サーバーテストの実行に必要なカスタムAntタスクの初期化 -->
            <taskdef name="runservertests" classname="org.apache.cactus.ant.RunServerTestsTask">
                <classpath>
                    <pathelement location="${cactus.ant.jar}"/>
                    <pathelement path="${java.class.path}"/>
                </classpath>
            </taskdef>
    
        </target>
    

    ステップ 4 : 'usage' ターゲット/Step 4 : 'usage' targets

    Display a usage message.

    使用法メッセージの表示

        <!--
           ========================================================================
             Help on usage. List available targets
           ========================================================================
        -->
        <target name="usage" depends="init">
    
            <echo message=""/>
            <echo message="${project.fullname} build file"/>
            <echo message="------------------------------------------------------"/>
            <echo message=""/>
            <echo message=" Available targets are :"/>
            <echo message=""/>
            <echo message=" war    --> generates the war file (default)"/>
            <echo message=" clean  --> cleans up the build directory"/>
            <echo message=" source --> generates source zip of the project"/>
            <echo message=" doc    --> generates the docs (javadoc, ...)"/>
            <echo message=" all    --> do it all at once"/>
            <echo message="            (clean, war, source, doc)"/>
            <echo message=""/>
            <echo message=" Targets for running the tests for Servlet API 2.2 :"/>
            <echo message=""/>
            <echo message=" tests_resin_12    --> run tests for Resin 1.2"/>
            <echo message=" tests_tomcat_32   --> run tests for Tomcat 3.2"/>
            <echo message=" tests_weblogic_51 --> run tests for WebLogic 5.1"/>
            <echo message=" tests_orion_14    --> run tests for Orion 1.4"/>
            <echo message=""/>
    
        </target>
    
        <!--
           ========================================================================
             使用法のヘルプ。利用可能なターゲットの一覧。
           ========================================================================
        -->
        <target name="usage" depends="init">
    
            <echo message=""/>
            <echo message="${project.fullname} build file"/>
            <echo message="------------------------------------------------------"/>
            <echo message=""/>
            <echo message=" 利用可能なターゲットは :"/>
            <echo message=""/>
            <echo message=" war    --> war ファイルを生成します (デフォルト)"/>
            <echo message=" clean  --> ビルドディレクトリをクリーンします"/>
            <echo message=" source --> プロジェクトのソースのZIPの生成"/>
            <echo message=" doc    --> docs の生成 (javadoc, ...)"/>
            <echo message=" all    --> 全ターゲットの実行"/>
            <echo message="            (clean, war, source, doc)"/>
            <echo message=""/>
            <echo message=" Servlet API 2.2 のテスト実行のためのターゲット :"/>
            <echo message=""/>
            <echo message=" tests_resin_12    --> Resin 1.2 のテスト実行"/>
            <echo message=" tests_tomcat_32   --> Tomcat 3.2 のテスト実行"/>
            <echo message=" tests_weblogic_51 --> WebLogic 5.1 のテスト実行"/>
            <echo message=" tests_orion_14    --> Orion 1.4 のテスト実行"/>
            <echo message=""/>
    
        </target>
    

    ステップ 5 : 'prepare' ターゲット/Step 5 : 'prepare' target

    This target is needed for both compiling and generating the javadoc. It copies all the source files from their src/ directory to the out directory, replacing tokens in the source code (replacing the 1.3 by the version number for example).

    このターゲットはコンパイルおよび javadoc の生成の両方で必要です。 ソースコード中のトークンを置換しながら、 src/ディレクトリの全てのソースファイルを outディレクトリにコピーします。 (例えば、1.3 をバージョン番号で置き換えます。)

        <!--
           ========================================================================
             Prepare the output directory by copying the source files into it
           ========================================================================
        -->
        <target name="prepare" depends="init">
    
            <mkdir dir="${out.src.dir}"/>
    
            <!-- Copy all source files to destination dir. Apply the filters in
                 order to replace the tokens for the copyright year and the
                 version -->
            <copy todir="${out.src.dir}" filtering="on">
                <fileset dir="${src.java.dir}">
                    <patternset refid="all.src.files"/>
                </fileset>
                <fileset dir="${src.java.servlet.dir}">
                    <patternset refid="all.src.files"/>
                </fileset>
            </copy>
    
        </target>
    
        <!--
           ========================================================================
             ソースファイルをコピーして出力ディレクトリを準備
           ========================================================================
        -->
        <target name="prepare" depends="init">
    
            <mkdir dir="${out.src.dir}"/>
    
            <!-- 全ソースファイルを出力ディレクトリにコピーします。
    	     トークンを著作権表示の年、およびバージョンで置換するために、
    	     フィルターを適用します。-->
            <copy todir="${out.src.dir}" filtering="on">
                <fileset dir="${src.java.dir}">
                    <patternset refid="all.src.files"/>
                </fileset>
                <fileset dir="${src.java.servlet.dir}">
                    <patternset refid="all.src.files"/>
                </fileset>
            </copy>
    
        </target>
    

    ステップ 6 : 'compile' ターゲット/Step 6 : 'compile' target

    The compile target simply compiles the java files into .class files and also copies the support files that are in src/ to the directory where the class file have been generated.

    compile ターゲットは単に、 java ファイルを .class ファイルにコンパイルし、さらに、 src/ にあるサポートファイルを、 クラスファイルが生成されたディレクトリにコピーします。

        <!--
           ========================================================================
             Compiles the source directory
           ========================================================================
        -->
        <!-- Preparation target for the compile target -->
        <target name="prepare-compile" depends="prepare">
    
            <mkdir dir="${out.classes.dir}"/>
    
        </target>
    
        <!-- Run the java compilation -->
        <target name="compile" depends="prepare-compile">
    
            <javac srcdir="${out.src.dir}"
                destdir="${out.classes.dir}"
                debug="${debug}"
                deprecation="${deprecation}"
                optimize="${optimize}">
    
                <!-- Exclude all files that are not .java source files -->
    
                <!-- All doc files -->
                <exclude name="**/package.html"/>
                <exclude name="**/overview.html"/>
    
                <!-- All conf files (including test files) -->
                <exclude name="**/*.txt"/>
                <exclude name="**/*.xml"/>
                <exclude name="**/*.properties"/>
    
                <classpath>
                    <pathelement path="${java.class.path}"/>
                    <pathelement location="${servlet.jar}"/>
                    <pathelement location="${cactus.jar}"/>
                </classpath>
    
            </javac>
    
            <!-- Copies non java files that need to be in the classes directory -->
            <copy todir="${out.classes.dir}">
                <fileset dir="${src.java.dir}">
                    <patternset refid="all.nonjava.files"/>
                </fileset>
                <fileset dir="${conf.test.dir}">
                    <include name="cactus.properties"/>
                </fileset>
            </copy>
    
        </target>
    
        <!--
           ========================================================================
             Compiles the source directory
           ========================================================================
        -->
        <!-- Preparation target for the compile target -->
        <target name="prepare-compile" depends="prepare">
    
            <mkdir dir="${out.classes.dir}"/>
    
        </target>
    
        <!-- Run the java compilation -->
        <target name="compile" depends="prepare-compile">
    
            <javac srcdir="${out.src.dir}"
                destdir="${out.classes.dir}"
                debug="${debug}"
                deprecation="${deprecation}"
                optimize="${optimize}">
    
                <!-- Exclude all files that are not .java source files -->
    
                <!-- All doc files -->
                <exclude name="**/package.html"/>
                <exclude name="**/overview.html"/>
    
                <!-- All conf files (including test files) -->
                <exclude name="**/*.txt"/>
                <exclude name="**/*.xml"/>
                <exclude name="**/*.properties"/>
    
                <classpath>
                    <pathelement path="${java.class.path}"/>
                    <pathelement location="${servlet.jar}"/>
                    <pathelement location="${cactus.jar}"/>
                </classpath>
    
            </javac>
    
            <!-- Copies non java files that need to be in the classes directory -->
            <copy todir="${out.classes.dir}">
                <fileset dir="${src.java.dir}">
                    <patternset refid="all.nonjava.files"/>
                </fileset>
                <fileset dir="${conf.test.dir}">
                    <include name="cactus.properties"/>
                </fileset>
            </copy>
    
        </target>
    
        <!--
           ========================================================================
             ソースディレクトリのコンパイル
           ========================================================================
        -->
        <!-- コンパイルターゲットのための準備ターゲット -->
        <target name="prepare-compile" depends="prepare">
    
            <mkdir dir="${out.classes.dir}"/>
    
        </target>
    
        <!-- java のコンパイルの実行 -->
        <target name="compile" depends="prepare-compile">
    
            <javac srcdir="${out.src.dir}"
                destdir="${out.classes.dir}"
                debug="${debug}"
                deprecation="${deprecation}"
                optimize="${optimize}">
    
                <!-- .java ソースファイル以外を除外する -->
    
                <!-- 全 doc ファイル -->
                <exclude name="**/package.html"/>
                <exclude name="**/overview.html"/>
    
                <!-- 全 conf ファイル (テストファイルを含む) -->
                <exclude name="**/*.txt"/>
                <exclude name="**/*.xml"/>
                <exclude name="**/*.properties"/>
    
                <classpath>
                    <pathelement path="${java.class.path}"/>
                    <pathelement location="${servlet.jar}"/>
                    <pathelement location="${cactus.jar}"/>
                </classpath>
    
            </javac>
    
            <!-- クラスディレクトリに置く必要がある java でないファイルのコピー -->
            <copy todir="${out.classes.dir}">
                <fileset dir="${src.java.dir}">
                    <patternset refid="all.nonjava.files"/>
                </fileset>
                <fileset dir="${conf.test.dir}">
                    <include name="cactus.properties"/>
                </fileset>
            </copy>
    
        </target>
    

    ステップ 7 : 'source' ターゲット/Step 7 : 'source' target

    Zip up the sources for distribution.

    ディストリビューションのためのソースのZIPアーカイブの作成

        <!--
           ========================================================================
             Generates source zip of the project
           ========================================================================
        -->
        <target name="source" depends="prepare">
    
            <zip zipfile="${final.src.name}" basedir=".">
    
                <exclude name="${out.dir}/**"/>
                <exclude name="**/*.log"/>
                <exclude name="**/*.bak"/>
                <exclude name="**/*.class"/>
                <exclude name="${build.dir}/build.properties"/>
    
            </zip>
    
        </target>
    
        <!--
           ========================================================================
             プロジェクトのソースの ZIP アーカイブの生成
           ========================================================================
        -->
        <target name="source" depends="prepare">
    
            <zip zipfile="${final.src.name}" basedir=".">
    
                <exclude name="${out.dir}/**"/>
                <exclude name="**/*.log"/>
                <exclude name="**/*.bak"/>
                <exclude name="**/*.class"/>
                <exclude name="${build.dir}/build.properties"/>
    
            </zip>
    
        </target>
    

    ステップ 8 : 'javadoc' ターゲット/Step 8 : 'javadoc' target

    Generate the project's javadoc.

    プロジェクトの javadoc の生成

        <!--
           ========================================================================
             Generate the javadoc
           ========================================================================
        -->
        <!-- Preparation target for the javadoc target -->
        <target name="prepare-javadoc" depends="prepare">
    
            <mkdir dir="${out.javadoc.dir}"/>
    
        </target>
    
        <!-- Generate the javadoc for the current Servlet API -->
        <target name="javadoc" depends="prepare-javadoc">
    
            <javadoc
                sourcepath="${out.src.dir}"
                packagenames="org.apache.cactus.sample.*"
                destdir="${out.javadoc.dir}"
                author="true"
                public="true"
                version="true"
                use="true"
                windowtitle="${project.fullname} ${project.version} for Servlet @servlet.api@ API"
                doctitle="${project.fullname} ${project.version} for Servlet @servlet.api@ API"
                bottom="Copyright &amp;copy; ${year} Apache Software Foundation. All Rights Reserved.">
    
                <classpath>
                    <pathelement path="${java.class.path}"/>
                    <pathelement location="${servlet.jar}"/>
                    <pathelement location="${cactus.jar}"/>
                </classpath>
    
            </javadoc>
    
        </target>
    
        <!--
           ========================================================================
             javadoc の生成
           ========================================================================
        -->
        <!-- javadoc ターゲットのための準備ターゲット -->
        <target name="prepare-javadoc" depends="prepare">
    
            <mkdir dir="${out.javadoc.dir}"/>
    
        </target>
    
        <!-- 現在の Servlet API 用の javadoc の生成 -->
        <target name="javadoc" depends="prepare-javadoc">
    
            <javadoc
                sourcepath="${out.src.dir}"
                packagenames="org.apache.cactus.sample.*"
                destdir="${out.javadoc.dir}"
                author="true"
                public="true"
                version="true"
                use="true"
                windowtitle="${project.fullname} ${project.version} for Servlet @servlet.api@ API"
                doctitle="${project.fullname} ${project.version} for Servlet @servlet.api@ API"
                bottom="Copyright &amp;copy; ${year} Apache Software Foundation. All Rights Reserved.">
    
                <classpath>
                    <pathelement path="${java.class.path}"/>
                    <pathelement location="${servlet.jar}"/>
                    <pathelement location="${cactus.jar}"/>
                </classpath>
    
            </javadoc>
    
        </target>
    

    ステップ 9 : 'doc' ターゲット/Step 9 : 'doc' target

    Generate the project's documentation. It includes the javadoc, additional README files (if any) and the documentation web site (built using Stylebook for example, as shown in the example below).

    プロジェクトのドキュメントの生成。 これには、javadoc や、 (あれば)付加的な README ファイルや、 ウェブサイト用のドキュメント (例えば、下の例のように stylebook を使って生成されます。) が含まれます。

    Example not using Stylebook :

    stylebook を使わない例 :

        <!--
           ========================================================================
             Generate the full documentation
           ========================================================================
        -->
        <!-- Preparation target for the doc target -->
        <target name="prepare-doc" depends="javadoc">
    
            <mkdir dir="${out.doc.dir}"/>
    
        </target>
    
        <!-- Generate the documentation -->
        <target name="doc" depends="prepare-doc">
    
            <!-- Create the zipped documentation -->
            <zip zipfile="${final.doc.name}" basedir="${out.doc.dir}"/>
    
        </target>
    
        <!--
           ========================================================================
             全ドキュメントの生成
           ========================================================================
        -->
        <!-- doc ターゲットの準備ターゲットPreparation target for the doc target
        <target name="prepare-doc" depends="javadoc">
    
            <mkdir dir="${out.doc.dir}"/>
    
        </target>
    
        <!-- ドキュメントの生成 -->
        <target name="doc" depends="prepare-doc">
    
            <!-- Create the zipped documentation -->
            <zip zipfile="${final.doc.name}" basedir="${out.doc.dir}"/>
    
        </target>
    

    Example using Stylebook (from the Cactus build file itself) :

    stylebook を使った例(Cactus ビルドファイル自身より) :

        <!--
           ========================================================================
             Generate the full documentation for a given Servlet API, i.e.
             web site + javadoc
           ========================================================================
        -->
        <!-- Preparation target for the doc target -->
        <target name="prepare-doc" depends="javadoc">
    
            <mkdir dir="${out.doc.dir}"/>
            <mkdir dir="${out.doc.dir}/images"/>
    
            <!-- Copy doc-book.xml to book.xml for defining the documentation web
                 site and replacing token filters (year) -->
            <delete file="${xdoc.dir}/book.xml"/>
            <copy file="${xdoc.dir}/doc-book.xml" tofile="${xdoc.dir}/book.xml"
                filtering="on"/>
    
            <!-- Copy the images -->
            <copy todir="${out.site.dir}/images">
                <fileset dir="${xdoc.dir}/images"/>
            </copy>
    
        </target>
    
        <!-- Generate the documentation -->
        <target name="doc" depends="prepare-doc">
    
            <!-- Generate the documentation web site -->
            <stylebook book="${xdoc.dir}/book.xml"
                skinDirectory="${skin.dir}/jakarta.apache.org"
                targetDirectory="${out.doc.dir}">
    
                <classpath>
                    <pathelement path="${java.class.path}"/>
                </classpath>
    
            </stylebook>
    
        </target>
    
        <!--
           ========================================================================
    	 与えられた Servlet API 用の全ドキュメントの生成。
    	 即ち、ウェブサイト + javadoc
           ========================================================================
        -->
        <!-- doc ターゲットのための準備ターゲット -->
        <target name="prepare-doc" depends="javadoc">
    
            <mkdir dir="${out.doc.dir}"/>
            <mkdir dir="${out.doc.dir}/images"/>
    
            <!-- ドキュメントのウェブサイトを定義し、
    	     トークンフィルター(year)を置換するために、
    	     doc-book.xml を book.xml にコピー -->
            <delete file="${xdoc.dir}/book.xml"/>
            <copy file="${xdoc.dir}/doc-book.xml" tofile="${xdoc.dir}/book.xml"
                filtering="on"/>
    
            <!-- 画像のコピー -->
            <copy todir="${out.site.dir}/images">
                <fileset dir="${xdoc.dir}/images"/>
            </copy>
    
        </target>
    
        <!-- ドキュメントの生成 -->
        <target name="doc" depends="prepare-doc">
    
            <!-- ウェブサイトのドキュメントの生成 -->
            <stylebook book="${xdoc.dir}/book.xml"
                skinDirectory="${skin.dir}/jakarta.apache.org"
                targetDirectory="${out.doc.dir}">
    
                <classpath>
                    <pathelement path="${java.class.path}"/>
                </classpath>
    
            </stylebook>
    
        </target>
    

    ステップ 10 : 'clean' ターゲット/Step 10 : 'clean' target

    Removes all build generated files.

    ビルドにより生成された全ファイルの削除

        <!--
           ========================================================================
             Remove all build generated files
           ========================================================================
        -->
        <target name="clean" depends="init">
    
            <!-- Deletes all files ending with '~' -->
            <delete>
                <fileset dir="." includes="**/*~" defaultexcludes="no"/>
            </delete>
    
            <!-- Remove the out directory -->
            <delete dir="${out.dir}"/>
    
            <!-- Delete log files -->
            <delete>
                <fileset dir=".">
                    <include name="**/*.log"/>
                </fileset>
            </delete>
    
        </target>
    
        <!--
           ========================================================================
             ビルドにより生成された全ファイルの削除
           ========================================================================
        -->
        <target name="clean" depends="init">
    
            <!-- '~' で終る全ファイルの削除 -->
            <delete>
                <fileset dir="." includes="**/*~" defaultexcludes="no"/>
            </delete>
    
            <!-- 出力先ディレクトリの削除 -->
            <delete dir="${out.dir}"/>
    
            <!-- ログファイルの削除 -->
            <delete>
                <fileset dir=".">
                    <include name="**/*.log"/>
                </fileset>
            </delete>
    
        </target>
    

    ステップ 11 : 'jar'、'war' ターゲット/Step 11 : 'jar', 'war' targets

    'jar' ターゲット/'jar' target

    This target is useful if your project is a framework for example and you need to deliver a jar file. We also include a manifest file in the jar, with version information. We copy the manifest to the output directory in order to replace the 1.3 token with it's value.

    このターゲットは、例えば、自分のプロジェクトが、 フレームワークで 'jar' ファイルで配布する必要があるときに便利です。 jar ファイルには、バージョン情報を持ったマニフェストファイルも入れます。 1.3 トークンを、その値に置換するために、 マニフェストファイルを出力ディレクトリにコピーします。

    Example (from the Cactus build file) :

    例 (Cactus ビルドファイルより) :

        <!--
           ========================================================================
             Create the runtime jar file
           ========================================================================
        -->
        <!-- Preparation target for the jar target -->
        <target name="prepare-jar" depends="compile">
    
            <mkdir dir="${out.conf.dir}"/>
            <mkdir dir="${out.lib.dir}"/>
    
            <!-- Copy the manifest in order to replace the version token filter -->
            <copy todir="${out.conf.dir}" filtering="on">
                <fileset dir="${conf.dir}" >
                    <include name="manifest"/>
                </fileset>
            </copy>
    
        </target>
    
        <!-- Generate the jar file -->
        <target name="jar" depends="prepare-jar">
    
            <jar jarfile="${final.jar.name}" basedir="${out.classes.dir}"
                manifest="${out.conf.dir}/manifest">
    
                <!-- Do not include test files in the runtime jar -->
                <exclude name="**/Test*.*"/>
                <exclude name="**/test*.*"/>
    
            </jar>
    
        </target>
    
        <!--
           ========================================================================
             ランタイム jar ファイルの生成
           ========================================================================
        -->
        <!-- jar ターゲットのための準備ターゲット -->
        <target name="prepare-jar" depends="compile">
    
            <mkdir dir="${out.conf.dir}"/>
            <mkdir dir="${out.lib.dir}"/>
    
            <!-- バージョンのトークンフィルターを置換するために、
    	     マニフェストをコピー -->
            <copy todir="${out.conf.dir}" filtering="on">
                <fileset dir="${conf.dir}" >
                    <include name="manifest"/>
                </fileset>
            </copy>
    
        </target>
    
        <!-- jar ファイルの生成 -->
        <target name="jar" depends="prepare-jar">
    
            <jar jarfile="${final.jar.name}" basedir="${out.classes.dir}"
                manifest="${out.conf.dir}/manifest">
    
                <!-- ランタイム jar ではテストファイルを含めない -->
                <exclude name="**/Test*.*"/>
                <exclude name="**/test*.*"/>
    
            </jar>
    
        </target>
    

    'war' ターゲット/'war' target

    This target is useful if you're building a web application. We also include a manifest file in the war, with version information. We copy the manifest to the output directory in order to replace the 1.3 token with it's value.

    このターゲットはウェブアプリケーションを構築する時に便利です。 バージョン情報を持ったマニフェストファイルも war に入れます。 1.3 トークンをその値に置換するために、 マニフェストを出力ディレクトリにコピーします。

    Example (from the Cactus sample) :

    例 (Cactus のサンプルより) :

        <!--
           ========================================================================
             Create the runtime war file
           ========================================================================
        -->
        <!-- Preparation target for the war target -->
        <target name="prepare-war" depends="compile">
    
            <mkdir dir="${out.conf.dir}"/>
    
            <!-- Copy the manifest in order to replace the version token filter  -->
            <copy todir="${out.conf.dir}" filtering="on">
                <fileset dir="${conf.dir}" >
                    <include name="manifest"/>
                </fileset>
            </copy>
    
        </target>
    
        <!-- Generate the war file -->
        <target name="war" depends="prepare-war">
    
            <war warfile="${final.war.name}"
                 webxml="${conf.dir}/web.xml"
                 manifest="${out.conf.dir}/manifest">
    
                <classes dir="${out.classes.dir}">
                    <!-- Do not include test files in the runtime jar -->
                    <exclude name="**/Test*.*"/>
                    <exclude name="**/test*.*"/>
    
                    <!-- Also exclude the test cactus.properties file -->
                    <exclude name="cactus.properties"/>
                </classes>
    
                <fileset dir="${web.dir}">
                    <exclude name="test/**"/>
                </fileset>
            </war>
    
        </target>
    
        <!--
           ========================================================================
             ランタイム war ファイルの生成
           ========================================================================
        -->
        <!-- war ターゲットの準備ターゲット -->
        <target name="prepare-war" depends="compile">
    
            <mkdir dir="${out.conf.dir}"/>
    
            <!-- バージョントークンフィルターの置換のためにマニフェストをコピー -->
            <copy todir="${out.conf.dir}" filtering="on">
                <fileset dir="${conf.dir}" >
                    <include name="manifest"/>
                </fileset>
            </copy>
    
        </target>
    
        <!-- war ファイルの生成 -->
        <target name="war" depends="prepare-war">
    
            <war warfile="${final.war.name}"
                 webxml="${conf.dir}/web.xml"
                 manifest="${out.conf.dir}/manifest">
    
                <classes dir="${out.classes.dir}">
                    <!-- テストファイルをランタイムjarから除外 -->
                    <exclude name="**/Test*.*"/>
                    <exclude name="**/test*.*"/>
    
                    <!-- テスト用の cactus.properties ファイルも除外 -->
                    <exclude name="cactus.properties"/>
                </classes>
    
                <fileset dir="${web.dir}">
                    <exclude name="test/**"/>
                </fileset>
            </war>
    
        </target>
    


    ステップ 12 : 'tests_XXX' ターゲット/Step 12 : 'tests_XXX' target

    The tests_XXX target is in charge of running the Cactus unit tests. It must prepare the test environment for a given servlet engine and package the tests, start that servlet engine, run the tests by starting the JUnit runner and stop the servlet engine.

    tests_XXX ターゲットは、 Cactus 単体テストの実行を担当しています。 与えられたサーブレットエンジンのテスト環境の準備をし、 テストをパッケージ化し、サーブレットエンジンを実行し、 JUnit runner を起動することによりテストを実行し、 サーブレットエンジンを終了します。

    See the Using Cactus with Ant tutorial for details on to do this.

    これを行うための詳細については、 Ant での Cactus の利用 のチュートリアルを見てください。





    [訳注:これは 漆島賢二 が翻訳しました。日本語訳に対するコメントがあれば こちらに送ってください]
    Copyright © 2000-2002 The Apache Software Foundation. All Rights Reserved.