| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Ant-contrib Server Tasks</title> |
| 5 | </head> |
| 6 | |
| 7 | <body> |
| 8 | <h1>Ant-Contrib Server Tasks</h1> |
| 9 | |
| 10 | <p>The following tasks exist for running Ant server on one machine, and |
| 11 | calling that server from another (or possibly the same) machine, to |
| 12 | execute tasks.</p> |
| 13 | |
| 14 | |
| 15 | <hr width="100%" /> |
| 16 | |
| 17 | <h1>AntServer</h1> |
| 18 | |
| 19 | <p> |
| 20 | Starts an ANT server in current process. This server will wait for |
| 21 | client connections, and when received, it will execute the commands |
| 22 | that the client has sent. NOTE: This is a blocking call, and this |
| 23 | task will not return until someone sends the server a shutdown command. |
| 24 | </p> |
| 25 | |
| 26 | <h2>Parameters</h2> |
| 27 | |
| 28 | <table border="1" cellpadding="2" cellspacing="0"> |
| 29 | <tr> |
| 30 | <th>Attribute</th> |
| 31 | <th>Description</th> |
| 32 | <th>Required</th> |
| 33 | </tr> |
| 34 | <tr> |
| 35 | <td valign="top">port</td> |
| 36 | <td valign="top">The port on which the server will listen.</td> |
| 37 | <td align="center" valign="top">No. Defaults to 17000</td> |
| 38 | </tr> |
| 39 | </table> |
| 40 | |
| 41 | <h2>Example:</h2> |
| 42 | |
| 43 | <pre> |
| 44 | <code> |
| 45 | <antserver port="12345" /> |
| 46 | </code> |
| 47 | </pre> |
| 48 | |
| 49 | |
| 50 | <h1>RemoteAnt</h1> |
| 51 | |
| 52 | <p> |
| 53 | Sends command requests to a running instance of an AntServer which |
| 54 | was started using the <antserver> task. |
| 55 | These commands are executed in the space of the server, and therefore |
| 56 | have no access to any variables or references in the currently executing |
| 57 | project. |
| 58 | </p> |
| 59 | |
| 60 | <h2>Parameters</h2> |
| 61 | |
| 62 | <table border="1" cellpadding="2" cellspacing="0"> |
| 63 | <tr> |
| 64 | <th>Attribute</th> |
| 65 | <th>Description</th> |
| 66 | <th>Required</th> |
| 67 | </tr> |
| 68 | <tr> |
| 69 | <td valign="top">machine</td> |
| 70 | <td valign="top">The machine name on which the server is running.</td> |
| 71 | <td align="center" valign="top">No. Defaults to "localhost"</td> |
| 72 | </tr> |
| 73 | <tr> |
| 74 | <td valign="top">port</td> |
| 75 | <td valign="top">The port on which the server is listening.</td> |
| 76 | <td align="center" valign="top">No. Defaults to 17000</td> |
| 77 | </tr> |
| 78 | <tr> |
| 79 | <td valign="top">persistant</td> |
| 80 | <td valign="top">Should we execute all commands, regardless of whether |
| 81 | or not one of them fails. If false, as soon as a failure is encountered, |
| 82 | we will stop execution.</td> |
| 83 | <td align="center" valign="top">No. Defaults to false</td> |
| 84 | </tr> |
| 85 | <tr> |
| 86 | <td valign="top">failonerror</td> |
| 87 | <td valign="top">If any of the sent commands encounters a build failure on |
| 88 | the server, should we fail this task.</td> |
| 89 | <td align="center" valign="top">No. Defaults to true.</td> |
| 90 | </tr> |
| 91 | </table> |
| 92 | |
| 93 | <h2>Parameters Specified as Nested Elements</h2> |
| 94 | |
| 95 | <p> |
| 96 | The commands to send are represented as nested elements as described |
| 97 | below |
| 98 | </p> |
| 99 | |
| 100 | |
| 101 | <h3>runtarget</h3> |
| 102 | |
| 103 | <p>Runs a target which is contained in the same buildfile where the |
| 104 | <antserver> task was called. This element may contain nested |
| 105 | <property> elements for sending parameters to the target, and |
| 106 | nested <reference> elements for sending references to the target.</p> |
| 107 | |
| 108 | <h4>Parameters</h4> |
| 109 | <table border="1" cellpadding="2" cellspacing="0"> |
| 110 | <tr> |
| 111 | <th>Attribute</th> |
| 112 | <th>Description</th> |
| 113 | <th>Required</th> |
| 114 | </tr> |
| 115 | <tr> |
| 116 | <td valign="top">target</td> |
| 117 | <td valign="top">The name of the target to run.</td> |
| 118 | <td align="center" valign="top">Yes.</td> |
| 119 | </tr> |
| 120 | </table> |
| 121 | |
| 122 | <h3>runant</h3> |
| 123 | |
| 124 | <p>Runs a target in an arbitrary buildfile on the machine where the |
| 125 | <antserver> task was called. If a relative pathname is given, |
| 126 | then the path of the buildfile is relative to the base directory of |
| 127 | the project where the <antserver> task was called. This element |
| 128 | may contain nested <property> elements for sending text parameters |
| 129 | to the target, and nested <reference> elements for sending references |
| 130 | to the target.</p> |
| 131 | |
| 132 | <h4>Parameters</h4> |
| 133 | <table border="1" cellpadding="2" cellspacing="0"> |
| 134 | <tr> |
| 135 | <th>Attribute</th> |
| 136 | <th>Description</th> |
| 137 | <th>Required</th> |
| 138 | </tr> |
| 139 | <tr> |
| 140 | <td valign="top">antfile</td> |
| 141 | <td valign="top">The path of the ant file to run (if relative, then |
| 142 | the filename is computed relative to the buildfile of the server |
| 143 | task's base directory</td> |
| 144 | <td align="center" valign="top">No. Defaults to "build.xml" in the |
| 145 | directory where the buildfile is to execute (specified by the dir |
| 146 | attribute)</td> |
| 147 | </tr> |
| 148 | <tr> |
| 149 | <td valign="top">target</td> |
| 150 | <td valign="top">The name of the target to run.</td> |
| 151 | <td align="center" valign="top">No. Defaults to the default target of |
| 152 | the specified antfile.</td> |
| 153 | </tr> |
| 154 | <tr> |
| 155 | <td valign="top">dir</td> |
| 156 | <td valign="top">the directory to use as a basedir for the new Ant project. Defaults to |
| 157 | the server project's basedir, unless inheritall has been set to false, in which |
| 158 | case it doesn't have a default value. This will override the basedir setting of |
| 159 | the called project.</td> |
| 160 | <td align="center" valign="top">No.</td> |
| 161 | </tr> |
| 162 | <tr> |
| 163 | <td valign="top">inheritall</td> |
| 164 | <td valign="top">Should the target task inherit all of |
| 165 | the server's properties. This is equivalent to the flag of |
| 166 | the same name on the <ant> task.</td> |
| 167 | <td align="center" valign="top">No. Defaults to false</td> |
| 168 | </tr> |
| 169 | <tr> |
| 170 | <td valign="top">inheritrefs</td> |
| 171 | <td valign="top">Should the target task inherit all of |
| 172 | the server's references. This is equivalent to the flag of |
| 173 | the same name on the <ant> task.</td> |
| 174 | <td align="center" valign="top">No. Defaults to false</td> |
| 175 | </tr> |
| 176 | </table> |
| 177 | |
| 178 | |
| 179 | <h3>shutdown</h3> |
| 180 | |
| 181 | <p>Instructs the <antserver> task to shut itself down. Control |
| 182 | will return to the ANT engine and will procede as necessary in the |
| 183 | server's buildfile.</p> |
| 184 | |
| 185 | |
| 186 | <h2>Example:</h2> |
| 187 | |
| 188 | <pre> |
| 189 | <code> |
| 190 | <remoteant machine="localhost" port="12345"> |
| 191 | <runtarget target="execute.build"> |
| 192 | <property name="build.type" value="full" /> |
| 193 | </runtarget> |
| 194 | <runant dir="tests" target="build.tests"> |
| 195 | <property name="build.type" value="full" /> |
| 196 | <reference refid="my.ref" torefid="inherited.ref" /> |
| 197 | </runtarget> |
| 198 | </remoteant> |
| 199 | </code> |
| 200 | </pre> |
| 201 | |
| 202 | |
| 203 | <p> |
| 204 | would be the equivalent of running the following directly on |
| 205 | the server machine, from within the same buildfile where the |
| 206 | <antserver> task was run |
| 207 | </p> |
| 208 | |
| 209 | |
| 210 | <pre> |
| 211 | <code> |
| 212 | <antcall target="execute.build"> |
| 213 | <param name="build.type" value="full" /> |
| 214 | </antcall> |
| 215 | <ant dir="tests"> |
| 216 | <property name="build.type" value="full" /> |
| 217 | <reference refid="my.ref" torefid="inherited.ref" /> |
| 218 | </antcall> |
| 219 | </code> |
| 220 | </pre> |
| 221 | |
| 222 | <h3>sendfile</h3> |
| 223 | |
| 224 | <p>Sends a file from the client to the server</p> |
| 225 | |
| 226 | <h4>Parameters</h4> |
| 227 | <table border="1" cellpadding="2" cellspacing="0"> |
| 228 | <tr> |
| 229 | <th>Attribute</th> |
| 230 | <th>Description</th> |
| 231 | <th>Required</th> |
| 232 | </tr> |
| 233 | <tr> |
| 234 | <td valign="top">file</td> |
| 235 | <td valign="top">The path of the file to send.</td> |
| 236 | <td align="center" valign="top">Yes.</td> |
| 237 | </tr> |
| 238 | <tr> |
| 239 | <td valign="top">tofile</td> |
| 240 | <td valign="top">The filename where the file is to be stored |
| 241 | on the server, if a relative path, then it is stored relative |
| 242 | to the server project's base directory.</td> |
| 243 | <td align="center" valign="top">No. If todir is specified</td> |
| 244 | </tr> |
| 245 | <tr> |
| 246 | <td valign="top">tofile</td> |
| 247 | <td valign="top">The directory where the file is to be stored |
| 248 | on the server, if a relative path, then it is stored relative |
| 249 | to the server project's base directory. The name of the file |
| 250 | will be the same name as the source file</td> |
| 251 | <td align="center" valign="top">No. If tofile is specified</td> |
| 252 | </tr> |
| 253 | </table> |
| 254 | |
| 255 | <hr> |
| 256 | <p align="center">Copyright © 2003 Ant-Contrib Project. All |
| 257 | rights Reserved.</p> |
| 258 | |
| 259 | </body> |
| 260 | </html> |