1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>Sound Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="sound">Sound</a></h2>
|
---|
28 | <h3>Description</h3>
|
---|
29 | <p>Plays a sound-file at the end of the build, according to whether
|
---|
30 | the build failed or succeeded. You can specify either a specific
|
---|
31 | sound-file to play, or, if a directory is specified, the
|
---|
32 | <code><sound></code> task will randomly select a file to play.
|
---|
33 | Note: At this point, the random selection is based on all the files
|
---|
34 | in the directory, not just those ending in appropriate suffixes
|
---|
35 | for sound-files, so be sure you only have sound-files in the
|
---|
36 | directory you specify.</p>
|
---|
37 | <p>
|
---|
38 | Unless you are running on Java 1.3 or later, you need the Java Media Framework
|
---|
39 | on the classpath (javax.sound).
|
---|
40 | </p>
|
---|
41 |
|
---|
42 |
|
---|
43 | <h3>Nested Elements</h3>
|
---|
44 | <h4>success</h4>
|
---|
45 | <p>Specifies the sound to be played if the build succeeded.</p>
|
---|
46 | <h4>fail</h4>
|
---|
47 | <p>Specifies the sound to be played if the build failed.</p>
|
---|
48 |
|
---|
49 | <h3>Nested Element Parameters</h3>
|
---|
50 | <p>
|
---|
51 | The following attributes may be used on the <code><success></code>
|
---|
52 | and <code><fail></code> elements:</p>
|
---|
53 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
54 | <tr>
|
---|
55 | <td valign="top"><b>Attribute</b></td>
|
---|
56 | <td valign="top"><b>Description</b></td>
|
---|
57 | <td align="center" valign="top"><b>Required</b></td>
|
---|
58 | </tr>
|
---|
59 | <tr>
|
---|
60 | <td valign="top">source</td>
|
---|
61 | <td valign="top">the path to a sound-file directory, or the name of a
|
---|
62 | specific sound-file, to be played.
|
---|
63 | </td>
|
---|
64 | <td valign="top" align="center">Yes</td>
|
---|
65 | </tr>
|
---|
66 | <tr>
|
---|
67 | <td valign="top">loops</td>
|
---|
68 | <td valign="top">the number of extra times to play the sound-file;
|
---|
69 | default is <code>0</code>.
|
---|
70 | </td>
|
---|
71 | <td valign="top" align="center">No</td>
|
---|
72 | </tr>
|
---|
73 | <tr>
|
---|
74 | <td valign="top">duration</td>
|
---|
75 | <td valign="top">the amount of time (in milliseconds) to play
|
---|
76 | the sound-file.
|
---|
77 | </td>
|
---|
78 | <td valign="top" align="center">No</td>
|
---|
79 | </tr>
|
---|
80 | </table>
|
---|
81 |
|
---|
82 | <h3>Examples</h3>
|
---|
83 | <blockquote>
|
---|
84 | <pre>
|
---|
85 | <target name="fun" if="fun" unless="fun.done">
|
---|
86 | <sound>
|
---|
87 | <success source="${user.home}/sounds/bell.wav"/>
|
---|
88 | <fail source="${user.home}/sounds/ohno.wav" loops="2"/>
|
---|
89 | </sound>
|
---|
90 | <property name="fun.done" value="true"/>
|
---|
91 | </target>
|
---|
92 | </pre>
|
---|
93 | </blockquote>
|
---|
94 | plays the <code>bell.wav</code> sound-file if the build succeeded, or
|
---|
95 | the <code>ohno.wav</code> sound-file if the build failed, three times,
|
---|
96 | if the <code>fun</code> property is set to <code>true</code>.
|
---|
97 | If the target
|
---|
98 | is a dependency of an "initialization" target that other
|
---|
99 | targets depend on, the
|
---|
100 | <code>fun.done</code> property prevents the target from being executed
|
---|
101 | more than once.
|
---|
102 | <blockquote>
|
---|
103 | <pre>
|
---|
104 | <target name="fun" if="fun" unless="fun.done">
|
---|
105 | <sound>
|
---|
106 | <success source="//intranet/sounds/success"/>
|
---|
107 | <fail source="//intranet/sounds/failure"/>
|
---|
108 | </sound>
|
---|
109 | <property name="fun.done" value="true"/>
|
---|
110 | </target>
|
---|
111 | </pre>
|
---|
112 | </blockquote>
|
---|
113 | randomly selects a sound-file to play when the build succeeds or fails.
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 | </body>
|
---|
118 | </html>
|
---|
119 |
|
---|