Browse Source

Merge across from Ant 1.4.1 changes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269771 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
11f6c1a20b
2 changed files with 34 additions and 21 deletions
  1. +21
    -14
      docs/manual/OptionalTasks/sound.html
  2. +13
    -7
      src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java

+ 21
- 14
docs/manual/OptionalTasks/sound.html View File

@@ -19,12 +19,31 @@ for sound-files, so be sure you only have sound-files in the
directory you specify.</p> directory you specify.</p>


<h3>Parameters</h3> <h3>Parameters</h3>
<p>(none)</p>

<h3>Nested Elements</h3>
<h4>success</h4>
<p>Specifies the sound to be played if the build succeeded.</p>
<h4>fail</h4>
<p>Specifies the sound to be played if the build failed.</p>

<h3>Nested Element Parameters</h3>
<p>
The following attributes may be used on the <code>&lt;success&gt;</code>
and <code>&lt;fail&gt;</code> elements:</p>
<table border="1" cellpadding="2" cellspacing="0"> <table border="1" cellpadding="2" cellspacing="0">
<tr> <tr>
<td valign="top"><b>Attribute</b></td> <td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td> <td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td> <td align="center" valign="top"><b>Required</b></td>
</tr> </tr>
<tr>
<td valign="top">source</td>
<td valign="top">the path to a sound-file directory, or the name of a
specific sound-file, to be played.
</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr> <tr>
<td valign="top">loops</td> <td valign="top">loops</td>
<td valign="top">the number of extra times to play the sound-file; <td valign="top">the number of extra times to play the sound-file;
@@ -40,26 +59,14 @@ directory you specify.</p>
<td valign="top" align="center">No</td> <td valign="top" align="center">No</td>
</tr> </tr>
</table> </table>
<p>
To specify the sound-files or the sound-file directories, use the
nested <code>&lt;success&gt;</code> and <code>&lt;fail&gt;</code>
elements:</p>
<blockquote>
<pre>
&lt;success&gt; the path to a sound-file directory, or the name of a
specific sound-file, to be played if the build succeeded.
&lt;fail&gt; the path to a sound-file directory, or the name of a
specific sound-file, to be played if the build succeeded.
</pre>
</blockquote>


<h3>Examples</h3> <h3>Examples</h3>
<blockquote> <blockquote>
<pre> <pre>
&lt;target name=&quot;fun&quot; if=&quot;fun&quot; unless=&quot;fun.done&quot;&gt; &lt;target name=&quot;fun&quot; if=&quot;fun&quot; unless=&quot;fun.done&quot;&gt;
&lt;sound loops=&quot;2&quot;&gt;
&lt;sound&gt;
&lt;success source=&quot;${user.home}/sounds/bell.wav&quot;/&gt; &lt;success source=&quot;${user.home}/sounds/bell.wav&quot;/&gt;
&lt;fail source=&quot;${user.home}/sounds/ohno.wav&quot;/&gt;
&lt;fail source=&quot;${user.home}/sounds/ohno.wav&quot; loops=&quot;2&quot;/&gt;
&lt;/sound&gt; &lt;/sound&gt;
&lt;property name=&quot;fun.done&quot; value=&quot;true&quot;/&gt; &lt;property name=&quot;fun.done&quot; value=&quot;true&quot;/&gt;
&lt;/target&gt; &lt;/target&gt;


+ 13
- 7
src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java View File

@@ -327,6 +327,7 @@ public class Depend extends MatchingTask {
// now determine which jars each class depends upon // now determine which jars each class depends upon
classpathDependencies = new Hashtable(); classpathDependencies = new Hashtable();
AntClassLoader loader = new AntClassLoader(getProject(), dependClasspath); AntClassLoader loader = new AntClassLoader(getProject(), dependClasspath);
Hashtable classpathFileCache = new Hashtable(); Hashtable classpathFileCache = new Hashtable();
Object nullFileMarker = new Object(); Object nullFileMarker = new Object();
for (Enumeration e = dependencyMap.keys(); e.hasMoreElements();) { for (Enumeration e = dependencyMap.keys(); e.hasMoreElements();) {
@@ -510,14 +511,19 @@ public class Depend extends MatchingTask {
String className = (String)e.nextElement(); String className = (String)e.nextElement();
if (!outOfDateClasses.containsKey(className)) { if (!outOfDateClasses.containsKey(className)) {
ClassFileInfo info = (ClassFileInfo)classFileInfoMap.get(className); ClassFileInfo info = (ClassFileInfo)classFileInfoMap.get(className);
Hashtable dependencies = (Hashtable)classpathDependencies.get(className);
for (Enumeration e2 = dependencies.elements(); e2.hasMoreElements();) {
File classpathFile = (File)e2.nextElement();
if (classpathFile.lastModified() > info.absoluteFile.lastModified()) {
log("Class " + className +
// if we have no info about the class - it may have been deleted already and we
// are using cached info.
if (info != null) {
Hashtable dependencies = (Hashtable)classpathDependencies.get(className);
for (Enumeration e2 = dependencies.elements(); e2.hasMoreElements();) {
File classpathFile = (File)e2.nextElement();
if (classpathFile.lastModified() > info.absoluteFile.lastModified()) {
log("Class " + className +
" is out of date with respect to " + classpathFile, Project.MSG_DEBUG); " is out of date with respect to " + classpathFile, Project.MSG_DEBUG);
outOfDateClasses.put(className, className);
break;
outOfDateClasses.put(className, className);
break;
}
} }
} }
} }


Loading…
Cancel
Save