source: release-kits/wirk3/ant-scripts/tasks/antelope/docs/manual/bk03ch11.html@ 15023

Last change on this file since 15023 was 15023, checked in by oranfry, 16 years ago

did the bulk of the work on wirk3

File size: 3.5 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 11. Limit</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="Antelope Users Guide"><link rel="up" href="bk03.html" title="Additional Ant Tasks"><link rel="prev" href="bk03ch10.html" title="Chapter 10. Stopwatch"><link rel="next" href="bk03ch12.html" title="Chapter 12. FileUtils"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. Limit</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03ch10.html">Prev</a> </td><th width="60%" align="center">Additional Ant Tasks</th><td width="20%" align="right"> <a accesskey="n" href="bk03ch12.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Limit"></a>Chapter 11. Limit</h2></div></div></div>
2<STYLE TYPE="text/css"> <!-- @import url(./style.css); --> </STYLE>
3 <p>
4The Limit task is a task container (that is, it holds other tasks) and sets a time limit on how long the nested tasks are allowed to run. This is useful for unit tests that go awry, hung socket connections, or other potentially long running tasks that need to be shut off without stopping the build.
5</p><p>
6To use this task in your build files, include a task definition like this:
7</p><p>
8</p><pre class="programlisting">
9
10 &lt;taskdef name="limit" classname="ise.antelope.tasks.Limit"/&gt;
11
12</pre><p>
13</p><p>
14</p><div class="table"><a name="id2521623"></a><p class="title"><b>Table 11.1. Limit Task Attributes</b></p><table summary="Limit Task Attributes" border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td>maxwait</td><td>How long to wait for nested tasks to finish, this is in seconds.</td><td>180 seconds (3 minutes)</td><td>No</td></tr><tr><td>failonerror</td><td>Should the build fail if the time limit has been exceeded?</td><td>false</td><td>No</td></tr></tbody></table></div><p>
15</p><p>
16Examples:
17</p><p>
18Neither the echo nor the fail will happen in this example. The build will continue once the time has expired.
19</p><pre class="programlisting">
20
21&lt;limit maxwait="3"&gt;
22 &lt;sleep seconds="10"/&gt;
23 &lt;echo&gt;This won't happen...&lt;/echo&gt;
24 &lt;fail&gt;This won't happen either...&lt;/fail&gt;
25&lt;/limit&gt;
26
27</pre><p>
28</p><p>
29Neither the echo nor the fail will happen in this example. The build will not continue once the time has expired.
30</p><pre class="programlisting">
31
32&lt;limit maxwait="3" failonerror="true"&gt;
33 &lt;sleep seconds="10"/&gt;
34 &lt;echo&gt;This won't happen...&lt;/echo&gt;
35 &lt;fail&gt;This won't happen either...&lt;/fail&gt;
36&lt;/limit&gt;
37
38</pre><p>
39</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk03ch10.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk03ch12.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 10. Stopwatch </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 12. FileUtils</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.