You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

desc.html 26 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- Content Stylesheet for Site -->
  3. <!-- start the processing -->
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  7. <meta name="author" value="Conor MacNeill">
  8. <meta name="email" value="">
  9. <title>Mutant Proposal - Mutant Design Notes</title>
  10. </head>
  11. <body bgcolor="#ffffff" text="#000000" link="#525D76">
  12. <table border="0" width="100%" cellspacing="0">
  13. <!-- TOP IMAGE -->
  14. <tr>
  15. <td colspan="2">
  16. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a>
  17. </td>
  18. </tr>
  19. </table>
  20. <table border="0" width="100%" cellspacing="4">
  21. <tr><td colspan="2">
  22. <hr noshade="" size="1"/>
  23. </td></tr>
  24. <tr>
  25. <!-- LEFT SIDE NAVIGATION -->
  26. <td valign="top" nowrap="true">
  27. <p><strong>Mutant Proposal</strong></p>
  28. <ul>
  29. <li> <a href="./index.html">Introduction</a>
  30. </li>
  31. <li> <a href="./goals.html">Design Goals</a>
  32. </li>
  33. <li> <a href="./features.html">User Features</a>
  34. </li>
  35. <li> <a href="./developers.html">Task Developers</a>
  36. </li>
  37. <li> <a href="./design.html">Design Description</a>
  38. </li>
  39. </ul>
  40. </td>
  41. <td align="left" valign="top">
  42. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  43. <tr><td bgcolor="#525D76">
  44. <font color="#ffffff" face="arial,helvetica,sanserif">
  45. <a name="Mutant Design Notes"><strong>Mutant Design Notes</strong></a>
  46. </font>
  47. </td></tr>
  48. <tr><td>
  49. <blockquote>
  50. <p>
  51. This is a brief, albeit rambling description of Mutant.
  52. Mutant has many experimental ideas which may or may not prove useful.
  53. I'll try to describe what is there and let anyone who is interested
  54. comment. Mutant is still immature. You'll notice that there is, at this
  55. time, just one task, a hacked version of the echo task, which I have
  56. been using to test out ideas. Most tasks would end up being pretty
  57. similar to their Ant 1.x version.
  58. </p>
  59. <p>
  60. OK, let me start with some of the motivating requirements. There are of
  61. coure many Ant2 requirements but I want to focus on these two for now.
  62. Mutant does also address many of the other Ant2 requirements.
  63. </p>
  64. <p>
  65. I'll use the terms Ant and mutant somewhat interchangeably - just
  66. habit, not an assumption of any sort.
  67. </p>
  68. <p>
  69. One of the things which is pretty difficult in Ant 1.x is the
  70. management of classpaths and classloaders. For example, today the
  71. antlr task requires the antlr classes in the classpath used to start
  72. ant. I'm talking here about the classpath built up in the ant.bat/ant
  73. script launchers. At the same time, the checkstyle task
  74. which uses antlr won't run if the antlr classes are in the classpath
  75. because then those classes cannot "see" the classes in the taskdef's
  76. classpath.
  77. </p>
  78. <p>
  79. Another requirement I have is extensibility. In Ant 1.x this is
  80. difficult because whenever a new type is created, each task which
  81. needs to support this type must be changed to provide the new addXXX
  82. method. The ejbjar task is on example of this problem with its concept of vendor
  83. specific tools. The zip/jar task, with its support for different types
  84. of fileset, is another. The addition of the classfileset to Ant requires
  85. a change to the zip task.
  86. </p>
  87. </blockquote>
  88. </td></tr>
  89. </table>
  90. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  91. <tr><td bgcolor="#525D76">
  92. <font color="#ffffff" face="arial,helvetica,sanserif">
  93. <a name="Mutant Initialization"><strong>Mutant Initialization</strong></a>
  94. </font>
  95. </td></tr>
  96. <tr><td>
  97. <blockquote>
  98. <p>
  99. Mutant defines a classloader hierarchy somewhat similar to that used
  100. in Tomcat 4. Tasks join into this hierarchy at a particular point to
  101. ensure they have visibility of the necessary interface classes and no
  102. visibility of the Ant core itself. There is nothing particularly novel
  103. about this approach, but tasks are able to request certain additional resources
  104. as we will see later.
  105. </p>
  106. <p>
  107. Mutant starts with two jars. One is the start.jar which contains just
  108. one class, Main.java which establishes the initial configuration and
  109. then runs the appropriate front end command line class. If a different
  110. front end was desired, a different launch class, in its own jar, would
  111. be used. This would perhaps configure the classloader hierarchy somewhat
  112. differently and start the approriate GUI front end class.
  113. </p>
  114. <p>
  115. The second jar, init.jar, provides a number of initialisation utilities. These
  116. are used by Main.java to setup Ant and would also be used by any other front end
  117. to configure Ant. The important class here is the
  118. InitConfig which communicates the state of Ant at startup into the the core of
  119. Ant when it starts up. Main determines the location of ANT_HOME based on the
  120. location of the start classes and then populates the InitConfig with both
  121. classloaders and information about the location of various jars and config
  122. files.
  123. </p>
  124. <p>
  125. At the top of the classloader hierarchy
  126. are the bootstrap and system classloaders. I won't really
  127. distinguish between these in mutant. Combined they provide the JDK
  128. classes, plus the classes from the init and start jars. One objective is
  129. to keep the footprint of the init and start jars small so they do not
  130. require any external classes, which may then become visible lower in the
  131. hierarchy. Main does not explicitly create these loaders, of course, but
  132. just adds a reference to the init config as system class loader
  133. </p>
  134. <p>
  135. The next jar is for the common area. This provides interface definitions
  136. and utility classes for use by both the core and by tasks/types etc. It
  137. is loaded from ANT_HOME/lib/common/*.jar. Typically this is just
  138. lib/common/common.jar but any other jars in here are loaded. This
  139. pattern is used in the construction of all of the classloaders.
  140. </p>
  141. <p>
  142. Next up is the core loader. It includes the lib/antcore/antcore.jar plus
  143. any others including the XML parser jars. Mutant's core does not assume that
  144. the project model will come from an XML description but XML facilities
  145. are needed in the core for reading in Ant library defs and config files.
  146. The parser jar locations are also stored in the init config. This lets
  147. the jars be added to any Ant library that wants to use Ant's XML parser
  148. rather than providing its own. Similarly tools.jar's location is
  149. determined automatically and added to the config for use by tasks which
  150. request it. I'll go into more detail when discussing the antlib processing.
  151. </p>
  152. <p>
  153. The final jar that is loaded is the jar for the frontend - cli.jar. This
  154. is not passed in init config since these classes are not visible to the
  155. core and are not needed by it. So the hierarchy is
  156. <pre>
  157. jdk classes
  158. |
  159. start/init
  160. |
  161. common
  162. |
  163. antcore
  164. |
  165. cli
  166. </pre>
  167. </p>
  168. <p>
  169. Task classloaders generally will come in at common, hiding the core classes, front
  170. end and XML parser classes from tasks.
  171. </p>
  172. <p>
  173. Once Main has setup the initConfig, it creates the front end commandline
  174. class and launches mutant proper, passing it the command line args and
  175. the init config.
  176. </p>
  177. <p>
  178. A GUI would typically replace start.jar and the cli.jar with its own
  179. versions which manage model construction from GUI processes rather than
  180. from XML files. It may be possible to move some of Main.java's
  181. processing into init.jar if it is useful to other front ends. I haven't
  182. looked at that balance.
  183. </p>
  184. </blockquote>
  185. </td></tr>
  186. </table>
  187. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  188. <tr><td bgcolor="#525D76">
  189. <font color="#ffffff" face="arial,helvetica,sanserif">
  190. <a name="Mutant Frontend"><strong>Mutant Frontend</strong></a>
  191. </font>
  192. </td></tr>
  193. <tr><td>
  194. <blockquote>
  195. <p>
  196. The front end is responsible for coordinating execution of Ant. It
  197. manages command line arguments, builds a model of the Project to be
  198. evaluated and coordinates the execution services of the core. cli.jar
  199. contains not only the front-end code but also the XML parsing code for
  200. building a project model from an XML description. Other front ends may
  201. choose to build project models in different ways. Commandline is pretty
  202. similar to Ant 1.x's Main.java - it handles arguments, building loggers,
  203. listeners, defines, etc - actually I haven't fully implemented
  204. command line defines in
  205. mutant yet but it would be similar to Ant 1.x.
  206. </p>
  207. <p>
  208. Commandline then moves to building a project model from the XML
  209. representation. I have just expanded the approach in Ant 1's
  210. ProjectHelper for XML parsing, moving away from a stack of inner classes.
  211. The classes in the front end XML parsing use some XML utility base
  212. classes from the core.
  213. </p>
  214. <p>
  215. The XML parsing handles two elements at parse time. One is the &lt;ref&gt;
  216. element which is used for project references - that is relationships
  217. between project files. The referenced project is parsed as well. The
  218. second is the &lt;include&gt; element which includes either another complete
  219. project or a project &lt;fragment&gt; directly into the project. All the other
  220. elements are used to build a project model which is later processed in
  221. the core.
  222. </p>
  223. <p>
  224. The project model itself is organized like this
  225. </p>
  226. <p>
  227. <ul>
  228. <li>A project contains</li>
  229. <ul>
  230. <li>named references to other projects</li>
  231. <li>targets</li>
  232. <li>build elements (tasks, type instances)</li>
  233. </ul>
  234. <li>A target contains</li>
  235. <ul>
  236. <li>build elements (tasks, type instances)</li>
  237. </ul>
  238. <li>A build element contains</li>
  239. <ul>
  240. <li>build elements (nested elements)</li>
  241. </ul>
  242. </ul>
  243. </p>
  244. <p>
  245. So, for now the project model contains top level tasks and type
  246. instances. I'm still thinking about those and property scoping
  247. especially in the face of project refs and property overrides. Anyway,
  248. the running of these tasks is currently disabled.
  249. </p>
  250. <p>
  251. Once the model is built, the commandline creates an execution manager
  252. instance, passing it the initConfig built by Main.jar. It adds build
  253. listeners and then starts the build using the services of the
  254. ExecutionManager.
  255. </p>
  256. </blockquote>
  257. </td></tr>
  258. </table>
  259. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  260. <tr><td bgcolor="#525D76">
  261. <font color="#ffffff" face="arial,helvetica,sanserif">
  262. <a name="Ant Libraries"><strong>Ant Libraries</strong></a>
  263. </font>
  264. </td></tr>
  265. <tr><td>
  266. <blockquote>
  267. <p>
  268. Before we get into execution proper, I'll deal with the structure of an
  269. ant library and how it works. An antlibrary is a jar file with a library
  270. descriptor located in META-INF/antlib.xml. This defines what
  271. typedefs/taskdefs/converters the library makes available to Ant. The
  272. classes or at least some of the classes for the library will normally be
  273. available in the jar. The descriptor looks like this (I'll provide two
  274. examples here)
  275. </p>
  276. <p>
  277. <pre>
  278. &lt;antlib libid="ant.io"
  279. home="http://jakarta.apache.org/ant"
  280. isolated="true"&gt;
  281. &lt;typedef name="thread" classname="java.lang.Thread"/&gt;
  282. &lt;taskdef name="echo" classname="org.apache.ant.taskdef.io.Echo"/&gt;
  283. &lt;converter classname="org.apache.ant.taskdef.io.FileConverter"/&gt;
  284. &lt;/antlib&gt;
  285. &lt;antlib libid="ant.file"
  286. home="http://jakarta.apache.org/ant"
  287. reqxml="true" reqtools="true" extends="ant.io"
  288. isolated="true"&gt;
  289. &lt;taskdef name="copy" classname="org.apache.ant.file.copy"/&gt;
  290. &lt;/antlib&gt;
  291. </pre>
  292. </p>
  293. <p>
  294. the "libid" attribute is used to globally identify a library. It is used
  295. in Ant to pick which tasks you want to make available to a build file.
  296. As the number of tasks available goes up, this is used to prevent name
  297. collisions, etc. The name is constructed similarly to a Java package name -
  298. i.e Reverse DNS order.
  299. </p>
  300. <p>
  301. The "home" attribute is a bit of fluff unused by mutant to allow tools
  302. to manage libraries and update them etc. More thought could go into
  303. this.
  304. </p>
  305. <p>
  306. "reqxml" allows a library to say that it wants to use Ant's XML parser
  307. classes. Note that these will be coming from the library's classloader
  308. so they will not, in fact, be the same runtime classes as used in Ant's core,
  309. but it saves tasks packaging their own XML parsers.
  310. </p>
  311. <p>
  312. "reqtools" allows a library to specify that it uses classes from Sun's
  313. tools.jar file. Again, if tools.jar is available it will be added to the
  314. list of classes in the library's classloader
  315. </p>
  316. <p>
  317. "extends" allows for a single "inheritance" style relationship between
  318. libraries. I'm not sure how useful this may be yet but it seems
  319. important for accessing common custom types. It basically translates
  320. into the class loader for this library using the one identified in
  321. extends as its parent.
  322. </p>
  323. <p>
  324. "isolate" specifies that each task created from this libary comes from
  325. its own classloader. This can be used with tasks derived from Java
  326. applications which have static initialisers. This used to be an issue
  327. with the Anakia task, for example. Similarly it could be used to ensure that
  328. tool.jar classes are unloaded to stop memory leaks. Again this is
  329. experimental so may not prove ultimately useful.
  330. </p>
  331. <p>
  332. The &lt;typedef&gt; in the example creates a &lt;thread&gt; type. That is just a bit of fun which
  333. I'll use in an example later. It does show the typedefing of a type from
  334. outside the ant library however.
  335. </p>
  336. <p>
  337. &lt;taskdef&gt; is pretty obvious. It identifies a taskname with a class from
  338. the library. The import task, which I have not yet implemented will
  339. allow this name to be aliased - something like
  340. </p>
  341. <p>
  342. &lt;import libid="ant.file" task="echo" alias="antecho"/&gt;
  343. </p>
  344. <p>
  345. Tasks are not made available automatically. The build file must state
  346. which tasks it wants to use using an &lt;import&gt; task. This is similar to
  347. Java's import statement. Similarly classes whose ids start with "ant."
  348. are fully imported at the start of execution.
  349. </p>
  350. </blockquote>
  351. </td></tr>
  352. </table>
  353. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  354. <tr><td bgcolor="#525D76">
  355. <font color="#ffffff" face="arial,helvetica,sanserif">
  356. <a name="Mutant Configuration"><strong>Mutant Configuration</strong></a>
  357. </font>
  358. </td></tr>
  359. <tr><td>
  360. <blockquote>
  361. <p>
  362. When mutant starts execution, it reads in a config file. Actually it
  363. attempts to read two files, one from $ANT_HOME/conf/antconfig.xml and
  364. another from $HOME/.ant/antconfig.xml. Others could be added even
  365. specified in the command line. These config files are used to provide
  366. two things - libpaths and task dirs.
  367. </p>
  368. <p>
  369. Taskdirs are locations to search for additional ant libraries. As people
  370. bundle Ant tasks and types with their products, it will not be practical
  371. to bundle all this into ANT_HOME/lib. These additional dirs are scanned
  372. for ant libraries. All .zip/.jar/.tsk files which contain the
  373. META-INF/antlib.xml file will be processed.
  374. </p>
  375. <p>
  376. Sometimes, of course, the tasks and the libraries upon which they depend
  377. are not produced by the same people. It is not feasible to go in and
  378. edit manifests to connect the ant library with its required support
  379. jars, so the libpath element in the config file is used to specify
  380. additional paths to be added to a library's classloader. An example
  381. config would be
  382. </p>
  383. <p>
  384. <pre>
  385. &lt;antconfig&gt;
  386. &lt;libpath libid="ant.file" path="fubar"/&gt;
  387. &lt;libpath libid="ant.file" url="http://fubar"/&gt;
  388. &lt;/antconfig&gt;
  389. </pre>
  390. </p>
  391. <p>
  392. Obviously other information can be added to the config - standard
  393. property values, compiler prefs, etc. I haven't done that yet. User
  394. level config override system level configs.
  395. </p>
  396. <p>
  397. So, when a ant library creates a classloader, it will take a number of
  398. URLS. One is the task library itself, the XML parser classes if
  399. requested, the tools.jar if requested, and any additional libraries
  400. specified in the &lt;antconfig&gt;. The parent loader is the common loader
  401. from the initconfig. unless this library is an extending library.
  402. </p>
  403. </blockquote>
  404. </td></tr>
  405. </table>
  406. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  407. <tr><td bgcolor="#525D76">
  408. <font color="#ffffff" face="arial,helvetica,sanserif">
  409. <a name="Mutant Execution"><strong>Mutant Execution</strong></a>
  410. </font>
  411. </td></tr>
  412. <tr><td>
  413. <blockquote>
  414. <p>
  415. Execution of a build is provided by the core through two key classes.
  416. One if the ExecutionManager and the other is the ExecutionFrame. An
  417. execution frame is created for each project in the project model
  418. hierarchy. It represents the execution state of the project - data
  419. values, imported tasks, typedefs, taskdefs, etc.
  420. </p>
  421. <p>
  422. The ExecutionManager begins by reading configs, searching for ant
  423. libraries, configuring and appending any additional paths, etc. It then
  424. creates a root ExecutionFrame which represents the root project. when a
  425. build is commenced, the project model is validated and then passed to
  426. the ExecutionFrame.
  427. </p>
  428. <p>
  429. the ExecutionFrame is the main execution class. When it is created it
  430. imports all ant libraries with ids that start with ant.*. All others are
  431. available but must be explicitly imported with &lt;import&gt; tasks. When the
  432. project is passed in, ExecutionFrames are created for any referenced
  433. projects. This builds an ExecutionFrame hierarchy which parallels the
  434. project hierarchy. Each &lt;ref&gt; uses a name to identify the referenced
  435. project. All property and target references use these reference names to
  436. identify the particular frame that hold the data. As an example, look at
  437. this build file
  438. </p>
  439. <p>
  440. <pre>
  441. &lt;project default="test" basedir=".." doc:Hello="true"&gt;
  442. &lt;ref project="test.ant" name="reftest"/&gt;
  443. &lt;target name="test" depends="reftest:test2"&gt;
  444. &lt;echo message="hello"/&gt;
  445. &lt;/target&gt;
  446. &lt;/project&gt;
  447. </pre>
  448. </p>
  449. <p>
  450. Notice the depends reference to the test2 target in the test.ant project
  451. file. I am still using the ":" as a separator for refs. It doesn't
  452. collide with XML namespaces so that should be OK.
  453. </p>
  454. <p>
  455. Execution proceeds by determining the targets in the various frames
  456. which need to be executed. The appropriate frame is requested to execute
  457. the target's tasks and type instances. The imports for the frame are
  458. consulted to determine what is the approrpiate library and class from
  459. that library. A classloader is fetched, the class is instantiated,
  460. introspected and then configured from the corresponding part of the
  461. project model. Ant 1.x's IntrospectionHelper has been split into two -
  462. the ClassIntrospector and the Reflector. When the task is being
  463. configured, the context classloader is set. Similarly it is set when the
  464. task is being executed. Types are handled similarly. When a type in
  465. instantiated or a task executed, and they support the appropriate
  466. interface, they will be passed a context through which they can access
  467. the services of the core. Currently the context is an interface although
  468. I have wondered if an abstract class may be better to handle expansion
  469. of the services available over time.
  470. </p>
  471. </blockquote>
  472. </td></tr>
  473. </table>
  474. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  475. <tr><td bgcolor="#525D76">
  476. <font color="#ffffff" face="arial,helvetica,sanserif">
  477. <a name="Introspection and Polymorphism"><strong>Introspection and Polymorphism</strong></a>
  478. </font>
  479. </td></tr>
  480. <tr><td>
  481. <blockquote>
  482. <p>
  483. Introspection is not a lot different from Ant 1.x. After some thought I
  484. have dropped the createXXX method to allow for polymorphic type support, discussed
  485. below. setXXX methods, coupled with an approriate string to
  486. type converter are used for attributes. addXXX methods are used for
  487. nested elements. All of the value setting has been moved to a Reflector
  488. object. Object creation for addXXX methods is no longer provided in the
  489. reflector class, just the storage of the value. This allows support for
  490. add methods defined in terms of interfaces. For example, the hacked Echo
  491. task I am using has this definition
  492. </p>
  493. <p>
  494. <pre>
  495. /**
  496. * testing
  497. *
  498. * @param runnable testing
  499. */
  500. public void addRun(Runnable runnable) {
  501. log("Adding runnable of type "
  502. + runnable.getClass().getName(), MessageLevel.MSG_WARN);
  503. }
  504. </pre>
  505. </p>
  506. <p>
  507. So when mutant encounteres a nested element it does the following checks
  508. </p>
  509. <p>
  510. Is the value specified by reference?
  511. </p>
  512. <p>
  513. &lt;run ant:refid="test"/&gt;
  514. </p>
  515. <p>
  516. Is it specified by as a polymorphic type?
  517. </p>
  518. <p>
  519. &lt;run ant:type="thread"/&gt;
  520. </p>
  521. <p>
  522. or is it just a normal run o' the mill nested element, which is
  523. instantiated by a zero arg constructor.
  524. </p>
  525. <p>
  526. Note the use of the ant namespace for the metadata. In essence the
  527. nested element name &lt;run&gt; identifies the add method to be used, while
  528. the refId or type elements specify the actual instance or type to be
  529. used. The ant:type identifies an Ant datatype to be instantiated. If
  530. neither is specified, the type that is expected by the identified
  531. method, addRun in this case, is used to create an instance. In this case
  532. that would fail.
  533. </p>
  534. <p>
  535. Polymorphism, coupled with typedefs is one way, and a good way IMHO, of
  536. solving the extensibility of tasks such as ejbjar.
  537. </p>
  538. <p>
  539. OK, that is about the size of it. Let me finish with two complete build
  540. files and the result of running mutant on them.
  541. </p>
  542. <h3>build.ant</h3>
  543. <p>
  544. <pre>
  545. &lt;project default="test" basedir=".." doc:Hello="true"&gt;
  546. &lt;ref project="test.ant" name="reftest"/&gt;
  547. &lt;target name="test" depends="reftest:test2"&gt;
  548. &lt;echo message="hello"/&gt;
  549. &lt;/target&gt;
  550. &lt;/project&gt;
  551. </pre>
  552. </p>
  553. <h3>test.ant</h3>
  554. <p>
  555. <pre>
  556. &lt;project default="test" basedir="." doc:Hello="true"&gt;
  557. &lt;target name="test2"&gt;
  558. &lt;thread ant:id="testit"/&gt;
  559. &lt;echo message="hello2"&gt;
  560. &lt;run ant:refid="testit"&gt;
  561. &lt;/run&gt;
  562. &lt;/echo&gt;
  563. &lt;echo message="hello3"&gt;
  564. &lt;run ant:type="thread"&gt;
  565. &lt;/run&gt;
  566. &lt;/echo&gt;
  567. &lt;/target&gt;
  568. &lt;/project&gt;
  569. </pre>
  570. </p>
  571. <p>
  572. If I run mutant via a simple script which has just one line
  573. </p>
  574. <p>
  575. java -jar /home/conor/dev/mutant/dist/lib/start.jar $*
  576. </p>
  577. <p>
  578. I get this
  579. </p>
  580. <p>
  581. <pre>
  582. test2:
  583. [echo] Adding runnable of type java.lang.Thread
  584. [echo] hello2
  585. [echo] Adding runnable of type java.lang.Thread
  586. [echo] hello3
  587. test:
  588. [echo] hello
  589. BUILD SUCCESSFUL
  590. Total time: 0 seconds
  591. </pre>
  592. </p>
  593. <p>
  594. Lets change the &lt;run&gt; definition to
  595. </p>
  596. <p>
  597. &lt;run/&gt; in test.ant and the result becomes
  598. </p>
  599. <p>
  600. <pre>
  601. test2:
  602. [echo] Adding runnable of type java.lang.Thread
  603. [echo] hello2
  604. BUILD FAILED
  605. /home/conor/dev/mutant/test/test.ant:10:
  606. No element can be created for nested element &lt;run&gt;.
  607. Please provide a value by reference or specify the value type
  608. </pre>
  609. </p>
  610. </blockquote>
  611. </td></tr>
  612. </table>
  613. </td>
  614. </tr>
  615. <!-- FOOTER -->
  616. <tr><td colspan="2">
  617. <hr noshade="" size="1"/>
  618. </td></tr>
  619. <tr><td colspan="2">
  620. <div align="center"><font color="#525D76" size="-1"><em>
  621. Copyright &#169; 2000-2002, Apache Software Foundation
  622. </em></font></div>
  623. </td></tr>
  624. </table>
  625. </body>
  626. </html>
  627. <!-- end the processing -->