|
|
@@ -121,6 +121,22 @@ |
|
|
|
<li><a href="#no-gnu-tar"> |
|
|
|
I get checksum errors when I try to extract the |
|
|
|
<code>tar.gz</code> distribution file. Why? |
|
|
|
</a></li> |
|
|
|
</ul> |
|
|
|
</blockquote> |
|
|
|
</td></tr> |
|
|
|
</table> |
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%"> |
|
|
|
<tr><td bgcolor="#828DA6"> |
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif"> |
|
|
|
<strong>Using Ant</strong> |
|
|
|
</font> |
|
|
|
</td></tr> |
|
|
|
<tr><td> |
|
|
|
<blockquote> |
|
|
|
<ul> |
|
|
|
<li><a href="#always-recompiles"> |
|
|
|
Why does Ant always recompile all my Java files |
|
|
|
</a></li> |
|
|
|
</ul> |
|
|
|
</blockquote> |
|
|
@@ -155,6 +171,10 @@ |
|
|
|
<tr><td> |
|
|
|
<blockquote> |
|
|
|
<ul> |
|
|
|
<li><a href="#dtd"> |
|
|
|
Is there a DTD that I can use to validate my build |
|
|
|
files? |
|
|
|
</a></li> |
|
|
|
<li><a href="#xml-entity-include"> |
|
|
|
How do I include an XML snippet in my build file? |
|
|
|
</a></li> |
|
|
@@ -361,6 +381,37 @@ |
|
|
|
</blockquote> |
|
|
|
</td></tr> |
|
|
|
</table> |
|
|
|
</a> |
|
|
|
<a name="always-recompiles"> |
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%"> |
|
|
|
<tr><td bgcolor="#828DA6"> |
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif"> |
|
|
|
<strong> |
|
|
|
Why does Ant always recompile all my Java files |
|
|
|
</strong> |
|
|
|
</font> |
|
|
|
</td></tr> |
|
|
|
<tr><td> |
|
|
|
<blockquote> |
|
|
|
<p>In order to find out which files should be compiled, Ant |
|
|
|
compares the timestamps of the source files to those of the |
|
|
|
resulting <code>.class</code> 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 <code>srcdir</code> attribute.</p> |
|
|
|
<p>Say you have <code><javac srcdir="src" |
|
|
|
destdir="dest" /></code>. If Ant finds a file |
|
|
|
<code>src/a/b/C.java</code> it expects it to be in package |
|
|
|
<code>a.b</code> so that the resulting <code>.class</code> |
|
|
|
file is going to be <code>dest/a/b/C.class</code>.</p> |
|
|
|
<p>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.</p> |
|
|
|
</blockquote> |
|
|
|
</td></tr> |
|
|
|
</table> |
|
|
|
</a> |
|
|
|
<a name="integration"> |
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%"> |
|
|
@@ -430,7 +481,47 @@ |
|
|
|
</td></tr> |
|
|
|
</table> |
|
|
|
</a> |
|
|
|
<a name="xml-entity-include"> |
|
|
|
<a name="dtd"> |
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%"> |
|
|
|
<tr><td bgcolor="#828DA6"> |
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif"> |
|
|
|
<strong> |
|
|
|
Is there a DTD that I can use to validate my build |
|
|
|
files? |
|
|
|
</strong> |
|
|
|
</font> |
|
|
|
</td></tr> |
|
|
|
<tr><td> |
|
|
|
<blockquote> |
|
|
|
<p>An incomplete DTD can be created by the |
|
|
|
<code><antstructure></code> task - but this one |
|
|
|
has a few problems:</p> |
|
|
|
<ul> |
|
|
|
<li>It doesn't know about required attributes. Only |
|
|
|
manual tweaking of this file can help here.</li> |
|
|
|
|
|
|
|
<li>It is not complete - if you add new tasks via |
|
|
|
<code><taskdef></code> it won't know about it. See |
|
|
|
<a href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html">this |
|
|
|
page</a> 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.</li> |
|
|
|
|
|
|
|
<li>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 <code><test></code> and |
|
|
|
<code><junit></code> tasks, there are two XML |
|
|
|
elements named test (the task and the nested child element |
|
|
|
of <code><junit></code>) with different attribute |
|
|
|
lists. This problem cannot be solved, DTDs don't give a |
|
|
|
syntax rich enough to support this.</li> |
|
|
|
</ul> |
|
|
|
</blockquote> |
|
|
|
</td></tr> |
|
|
|
</table> |
|
|
|
</a> |
|
|
|
<a name="xml-entity-include"> |
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%"> |
|
|
|
<tr><td bgcolor="#828DA6"> |
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif"> |
|
|
@@ -525,7 +616,8 @@ |
|
|
|
<p>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</p> |
|
|
|
on <a href="http://java.sun.com/products/javamail/">JavaMail</a>, |
|
|
|
the source is</p> |
|
|
|
<div align="left"> |
|
|
|
<table cellspacing="4" cellpadding="0" border="0"> |
|
|
|
<tr> |
|
|
@@ -715,6 +807,10 @@ ant -listener BuildMonitor |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
<p>Make sure that <code>mail.jar</code> from JavaMail and |
|
|
|
<code>activation.jar</code> from the |
|
|
|
<a href="http://java.sun.com/products/javabeans/glasgow/jaf.html">Java |
|
|
|
Beans Activation Framework</a> in your <code>CLASSPATH</code>.</p> |
|
|
|
</blockquote> |
|
|
|
</td></tr> |
|
|
|
</table> |
|
|
|