From 1cd764447cbd26e40fb0b78aaa4b4cf3398d2a9a Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 26 Jun 2001 09:38:48 +0000 Subject: [PATCH] Add some FAQs. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269228 13f79535-47bb-0310-9956-ffa450edef68 --- webpage/docs/faq.html | 100 +++++++++++++++++++++++++++++++++++++++++- webpage/xdocs/faq.xml | 75 +++++++++++++++++++++++++++++-- 2 files changed, 170 insertions(+), 5 deletions(-) diff --git a/webpage/docs/faq.html b/webpage/docs/faq.html index 1b269e48d..776459d33 100644 --- a/webpage/docs/faq.html +++ b/webpage/docs/faq.html @@ -121,6 +121,22 @@
  • I get checksum errors when I try to extract the tar.gz distribution file. Why? +
  • + + + + + + +
    + + Using Ant + +
    +
    +
    @@ -155,6 +171,10 @@
    + + + + + +
    + + + Why does Ant always recompile all my Java files + + +
    +
    +

    In order to find out which files should be compiled, Ant + compares the timestamps of the source files to those of the + resulting .class files. Opening all source files + to find out which package they belong to would be very + inefficient - instead of this, Ant expects you to place your + source files in a directory hierarchy that mirrors your + package hierarchy and to point Ant to the root of this + directory tree with the srcdir attribute.

    +

    Say you have <javac srcdir="src" + destdir="dest" />. If Ant finds a file + src/a/b/C.java it expects it to be in package + a.b so that the resulting .class + file is going to be dest/a/b/C.class.

    +

    If your setup is different, Ant's heuristic won't work and + it will recompile classes that are up to date. Ant is not the + only tool, that expects a source tree layout like this.

    +
    +
    @@ -430,7 +481,47 @@
    - + + + + +
    + + + Is there a DTD that I can use to validate my build + files? + + +
    +
    +

    An incomplete DTD can be created by the + <antstructure> task - but this one + has a few problems:

    +
      +
    • It doesn't know about required attributes. Only + manual tweaking of this file can help here.
    • + +
    • It is not complete - if you add new tasks via + <taskdef> it won't know about it. See + this + page by Michel Casabianca for a solution to this + problem. Note that the DTD you can download at this page + is based on Ant 0.3.1.
    • + +
    • It may even be an invalid DTD. As Ant allows tasks + writers to define arbitrary elements, name collisions will + happen quite frequently - if your version of Ant contains + the optional <test> and + <junit> tasks, there are two XML + elements named test (the task and the nested child element + of <junit>) with different attribute + lists. This problem cannot be solved, DTDs don't give a + syntax rich enough to support this.
    • +
    +
    +
    +
    +
    @@ -525,7 +616,8 @@

    You can use a custom BuildListener, that sends out an email in the buildFinished() method. Will Glozer <will.glozer@jda.com> has written such a listener based - on JavaMail, the source is

    + on JavaMail, + the source is

    @@ -715,6 +807,10 @@ ant -listener BuildMonitor
    +

    Make sure that mail.jar from JavaMail and + activation.jar from the + Java + Beans Activation Framework in your CLASSPATH.

    diff --git a/webpage/xdocs/faq.xml b/webpage/xdocs/faq.xml index 84e72c902..28a0363aa 100644 --- a/webpage/xdocs/faq.xml +++ b/webpage/xdocs/faq.xml @@ -53,7 +53,7 @@ Tomcat.

    The first version of Ant that was exposed a lager audience - was the one that shipped with Tomcat's 3.1 release on 19 April + was the one that shipped with Tomcat's 3.1 release on 19 April 2000. This version has later been referenced to as Ant 0.3.1.

    @@ -112,6 +112,34 @@ + + + Why does Ant always recompile all my Java files + + +

    In order to find out which files should be compiled, Ant + compares the timestamps of the source files to those of the + resulting .class files. Opening all source files + to find out which package they belong to would be very + inefficient - instead of this, Ant expects you to place your + source files in a directory hierarchy that mirrors your + package hierarchy and to point Ant to the root of this + directory tree with the srcdir attribute.

    + +

    Say you have <javac srcdir="src" + destdir="dest" />. If Ant finds a file + src/a/b/C.java it expects it to be in package + a.b so that the resulting .class + file is going to be dest/a/b/C.class.

    + +

    If your setup is different, Ant's heuristic won't work and + it will recompile classes that are up to date. Ant is not the + only tool, that expects a source tree layout like this.

    + +
    +
    +
    + Is Ant supported by my IDE/Editor? @@ -122,7 +150,7 @@ - Why doesn't (X)Emacs parse the error messages generated + Why doesn't (X)Emacs parse the error messages generated by Ant correctly? @@ -151,6 +179,40 @@ + + Is there a DTD that I can use to validate my build + files? + + + +

    An incomplete DTD can be created by the + <antstructure> task - but this one + has a few problems:

    + +
    + + + How do I include an XML snippet in my build file? @@ -199,7 +261,8 @@

    You can use a custom BuildListener, that sends out an email in the buildFinished() method. Will Glozer <will.glozer@jda.com> has written such a listener based - on JavaMail, the source is

    + on JavaMail, + the source is

    + +

    Make sure that mail.jar from JavaMail and + activation.jar from the + Java + Beans Activation Framework in your CLASSPATH.

    +