2001-02-13 12:32:01 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2002-02-03 22:11:39 +00:00
|
|
|
<title>Sound Task</title>
|
2001-02-13 12:32:01 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="sound">Sound</a></h2>
|
|
|
|
<h3>Description</h3>
|
|
|
|
<p>Plays a sound-file at the end of the build, according to whether
|
|
|
|
the build failed or succeeded. You can specify either a specific
|
|
|
|
sound-file to play, or, if a directory is specified, the
|
|
|
|
<code><sound></code> task will randomly select a file to play.
|
|
|
|
Note: At this point, the random selection is based on all the files
|
|
|
|
in the directory, not just those ending in appropriate suffixes
|
|
|
|
for sound-files, so be sure you only have sound-files in the
|
|
|
|
directory you specify.</p>
|
2002-02-21 06:24:54 +00:00
|
|
|
<p>
|
|
|
|
Unless you are running on Java 1.3 or later, you need the Java Media Framework
|
|
|
|
on the classpath (javax.sound).
|
|
|
|
</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
|
2001-10-10 15:30:35 +00:00
|
|
|
|
|
|
|
<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><success></code>
|
|
|
|
and <code><fail></code> elements:</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
2001-10-10 15:30:35 +00:00
|
|
|
<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>
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">loops</td>
|
|
|
|
<td valign="top">the number of extra times to play the sound-file;
|
|
|
|
default is <code>0</code>.
|
|
|
|
</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">duration</td>
|
|
|
|
<td valign="top">the amount of time (in milliseconds) to play
|
|
|
|
the sound-file.
|
|
|
|
</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<h3>Examples</h3>
|
|
|
|
<blockquote>
|
|
|
|
<pre>
|
|
|
|
<target name="fun" if="fun" unless="fun.done">
|
2001-10-10 15:30:35 +00:00
|
|
|
<sound>
|
2001-02-13 12:32:01 +00:00
|
|
|
<success source="${user.home}/sounds/bell.wav"/>
|
2001-10-10 15:30:35 +00:00
|
|
|
<fail source="${user.home}/sounds/ohno.wav" loops="2"/>
|
2001-02-13 12:32:01 +00:00
|
|
|
</sound>
|
|
|
|
<property name="fun.done" value="true"/>
|
|
|
|
</target>
|
|
|
|
</pre>
|
|
|
|
</blockquote>
|
|
|
|
plays the <code>bell.wav</code> sound-file if the build succeeded, or
|
|
|
|
the <code>ohno.wav</code> sound-file if the build failed, three times,
|
|
|
|
if the <code>fun</code> property is set to <code>true</code>.
|
|
|
|
If the target
|
|
|
|
is a dependency of an "initialization" target that other
|
|
|
|
targets depend on, the
|
|
|
|
<code>fun.done</code> property prevents the target from being executed
|
|
|
|
more than once.
|
|
|
|
<blockquote>
|
|
|
|
<pre>
|
|
|
|
<target name="fun" if="fun" unless="fun.done">
|
2002-09-03 15:24:08 +00:00
|
|
|
<sound>
|
2001-02-13 12:32:01 +00:00
|
|
|
<success source="//intranet/sounds/success"/>
|
|
|
|
<fail source="//intranet/sounds/failure"/>
|
|
|
|
</sound>
|
|
|
|
<property name="fun.done" value="true"/>
|
|
|
|
</target>
|
|
|
|
</pre>
|
|
|
|
</blockquote>
|
|
|
|
randomly selects a sound-file to play when the build succeeds or fails.
|
|
|
|
|
|
|
|
<hr>
|
2005-03-07 18:11:14 +00:00
|
|
|
<p align="center">Copyright © 2001-2002,2004-2005 The Apache Software Foundation. All rights
|
2001-02-13 12:32:01 +00:00
|
|
|
Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|