diff --git a/docs/faq.html b/docs/faq.html index 279ba0c3d..504077f52 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -165,15 +165,12 @@ +
- Using Ant + How do I ...
+
+
+ + +
+ + It doesn't work (as expected) + +
+
+
@@ -613,46 +630,7 @@
- - - - -
- - - 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, 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 source-tree directory structure does not match your - package structure, 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.

-

If you have Java source files that aren't declared to - be part of any package, you can still use the <javac> - task to compile these files correctly - just set the - srcdir and destdir attributes to - the actual directory the source - files live in and the directory the class files should go into, - respectively.

-
-
-
- +
@@ -986,81 +964,6 @@ shell-prompt> cat < foo
-
- - - - -
- - - I've used a <delete> task to delete - unwanted - SourceSafe control files (CVS files, editor backup files, etc.), but - it doesn't seem to work; the files never get deleted. What's - wrong? - - -
-
-

This is probably happening because, by default, Ant excludes - SourceSafe control files (vssver.scc) and certain other - files from FileSets.

-

Here's what you probably did:

-
- - - - - - - - - - - - - - - - -
-<delete>
-  <fileset dir="${build.src}" includes="**/vssver.scc"/>
-</delete>
-
-
-

You need to switch off the default exclusions, - and it will work:

-
- - - - - - - - - - - - - - - - -
-<delete>
-  <fileset dir="${build.src}" includes="**/vssver.scc"
-           defaultexcludes="no"/>
-</delete>
-
-
-

For a complete listing of the patterns that are excluded - by default, see the user - manual.

-
-
@@ -1231,6 +1134,164 @@ shell-prompt> cat < foo
+
+ + + + +
+ + + How can I include national characters like German + umlauts in my build file? + + +
+
+

You need to tell the XML parser which character encoding + your build file uses, this is done inside the XML + declaration.

+

By default the parser assumes you are using the UTF-8 + encoding instead of your platform's default. For most Western + European countries you should set the encoding to + ISO-8859-1. To do so, make the very first line + of you build file read like

+
+ + + + + + + + + + + + + + + + +
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+
+
+
+
+ + + + +
+ + + 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, 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 source-tree directory structure does not match your + package structure, 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.

+

If you have Java source files that aren't declared to + be part of any package, you can still use the <javac> + task to compile these files correctly - just set the + srcdir and destdir attributes to + the actual directory the source + files live in and the directory the class files should go into, + respectively.

+
+
+
+ + + + +
+ + + I've used a <delete> task to + delete unwanted SourceSafe control files (CVS files, editor + backup files, etc.), but it doesn't seem to work; the files + never get deleted. What's wrong? + + +
+
+

This is probably happening because, by default, Ant excludes + SourceSafe control files (vssver.scc) and certain other + files from FileSets.

+

Here's what you probably did:

+
+ + + + + + + + + + + + + + + + +
+<delete>
+  <fileset dir="${build.src}" includes="**/vssver.scc"/>
+</delete>
+
+
+

You need to switch off the default exclusions, + and it will work:

+
+ + + + + + + + + + + + + + + + +
+<delete>
+  <fileset dir="${build.src}" includes="**/vssver.scc"
+           defaultexcludes="no"/>
+</delete>
+
+
+

For a complete listing of the patterns that are excluded + by default, see the user + manual.

+
+
@@ -1293,78 +1354,58 @@ shell-prompt> cat < foo

To get the files you want, focus on just the <include> patterns that would be necessary to get them. If you find you need to trim the list that the - <include> elements - produce, then use <exclude> elements.

+ <include> elements produce, then use + <exclude> elements.

- +
- How can I include national characters like German - umlauts in my build file? + ant failed to build my program via javac + even when I put the needed jars in an external + build.properties file and reference them by + pathelement or classpath refid.
-

You need to tell the XML parser which character encoding - your build file uses, this is done inside the XML - declaration.

-

By default the parser assumes you are using the UTF-8 - encoding instead of your platform's default. For most Western - European countries you should set the encoding to - ISO-8859-1. To do so, make the very first line - of you build file read like

-
- - - - - - - - - - - - - - - - -
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-
+

When ant loads properties from an external + file it dosn't touch the value of properties, trailing blanks + will not be trimmed for example.

+

If the value represents a file path, like a jar needed to + compile, the task which requires the value, javac for example + would fail to compile since it can't find the file due to + trailing spaces.

- +
- ant failed to build my program via javac - even when I put the needed jars in an external - build.properties file and reference them by - pathelement or classpath refid. + Ant creates WAR files with a lower-case + web-inf or JAR files with a lower-case + meta-inf directory.
-

When ant loads properties from an external - file it dosn't touch the value of properties, trailing blanks - will not be trimmed for example.

-

If the value represents a file path, like a jar needed to - compile, the task which requires the value, javac for example - would fail to compile since it can't find the file due to - trailing spaces.

+

No it doesn't.

+

You may have seen these lower-case directory names in + WinZIP, but WinZIP is trying to be helpful (and fails). If + WinZIP encounters a filename that is all upper-case, it + assumes it has come from an old DOS box andchanges the case to + all lower-case for you.

+

If you extract (or just check) the archive with jar, you + will see that the names have the correct case.

diff --git a/xdocs/faq.xml b/xdocs/faq.xml index 7e6489324..7c0c6962e 100644 --- a/xdocs/faq.xml +++ b/xdocs/faq.xml @@ -179,42 +179,7 @@ - - - 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, 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 source-tree directory structure does not match your - package structure, 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.

- -

If you have Java source files that aren't declared to - be part of any package, you can still use the <javac> - task to compile these files correctly - just set the - srcdir and destdir attributes to - the actual directory the source - files live in and the directory the class files should go into, - respectively.

- -
-
- + How do I pass parameters from the command line to my build file? @@ -363,44 +328,6 @@ shell-prompt> cat < foo - - - I've used a <delete> task to delete - unwanted - SourceSafe control files (CVS files, editor backup files, etc.), but - it doesn't seem to work; the files never get deleted. What's - wrong? - - -

This is probably happening because, by default, Ant excludes - SourceSafe control files (vssver.scc) and certain other - files from FileSets.

- -

Here's what you probably did:

- - - - - -]]> - -

You need to switch off the default exclusions, - and it will work:

- - - -]]> - -

For a complete listing of the patterns that are excluded - by default, see the user - manual.

- - - - I want to execute a particular target only if multiple conditions are true. @@ -523,6 +450,102 @@ shell-prompt> cat < foo + + How can I include national characters like German + umlauts in my build file? + + +

You need to tell the XML parser which character encoding + your build file uses, this is done inside the XML + declaration.

+ +

By default the parser assumes you are using the UTF-8 + encoding instead of your platform's default. For most Western + European countries you should set the encoding to + ISO-8859-1. To do so, make the very first line + of you build file read like

+ + +]]> +
+
+ + + + + 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, 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 source-tree directory structure does not match your + package structure, 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.

+ +

If you have Java source files that aren't declared to + be part of any package, you can still use the <javac> + task to compile these files correctly - just set the + srcdir and destdir attributes to + the actual directory the source + files live in and the directory the class files should go into, + respectively.

+ +
+
+ + + + I've used a <delete> task to + delete unwanted SourceSafe control files (CVS files, editor + backup files, etc.), but it doesn't seem to work; the files + never get deleted. What's wrong? + + +

This is probably happening because, by default, Ant excludes + SourceSafe control files (vssver.scc) and certain other + files from FileSets.

+ +

Here's what you probably did:

+ + + + + +]]> + +

You need to switch off the default exclusions, + and it will work:

+ + + +]]> + +

For a complete listing of the patterns that are excluded + by default, see the user + manual.

+ +
+
+ I have a target I want to skip if a property is set, so I have unless="property" as an attribute @@ -573,33 +596,11 @@ shell-prompt> cat < foo

To get the files you want, focus on just the <include> patterns that would be necessary to get them. If you find you need to trim the list that the - <include> elements - produce, then use <exclude> elements.

+ <include> elements produce, then use + <exclude> elements.

- - How can I include national characters like German - umlauts in my build file? - - -

You need to tell the XML parser which character encoding - your build file uses, this is done inside the XML - declaration.

- -

By default the parser assumes you are using the UTF-8 - encoding instead of your platform's default. For most Western - European countries you should set the encoding to - ISO-8859-1. To do so, make the very first line - of you build file read like

- - -]]> -
-
- ant failed to build my program via javac even when I put the needed jars in an external @@ -618,6 +619,25 @@ shell-prompt> cat < foo trailing spaces.

+ + + Ant creates WAR files with a lower-case + web-inf or JAR files with a lower-case + meta-inf directory. + + +

No it doesn't.

+ +

You may have seen these lower-case directory names in + WinZIP, but WinZIP is trying to be helpful (and fails). If + WinZIP encounters a filename that is all upper-case, it + assumes it has come from an old DOS box andchanges the case to + all lower-case for you.

+ +

If you extract (or just check) the archive with jar, you + will see that the names have the correct case.

+
+