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.

features.html 15 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Language" content="en-us">
  5. <title>Ant2 feature list</title>
  6. <style type="text/css">
  7. .comment {
  8. COLOR: #900000;
  9. BACKGROUND: #ffa;
  10. }
  11. </style>
  12. </head>
  13. <body bgcolor="#FFFFFF">
  14. <p class="comment">If something looks like this, this is either a
  15. request for input or a &quot;REVISIT&quot; marker or similar.</p>
  16. <h1>Ant2 Goals</h1>
  17. <p>Even though Ant2 is expected to be incompatible with the
  18. current Ant1 series, it still has the same goals. Ant is a Java
  19. based build tool and this remains the main focus of it. The
  20. original goals of simplicity, understandability and extensibility
  21. still stand and Ant2 will try to achieve them even better than
  22. Ant1 does.</p>
  23. <h2>Simplicity and Understandability</h2>
  24. <p>These two goals are closely related. Ant build files shall be
  25. easy to read and understand - at the same time it should be easy
  26. to write a custom Ant task and to use the utility classes that
  27. Ant2 provides.</p>
  28. <p>Ant2 shall be more consistent than Ant1 is - this means:</p>
  29. <ul>
  30. <li>core tasks will use the same attribute names for common
  31. functionality</li>
  32. <li>similar tasks will be unified to use similar forms.</li>
  33. <li>different implementations for the same functionality will be
  34. hidden behind facade tasks.</li>
  35. <li>properties and data types will be unified so that they share
  36. the same namespace and inheritance rules. <i
  37. class="comment">Need to talk about how ${} expansion works for
  38. filesets and so on.</i></li>
  39. </ul>
  40. <p>Furthermore some things will have to become more explicit:</p>
  41. <ul>
  42. <li>remove all magic properties</li>
  43. <li>make build file writers explicitly state which
  44. filters/filtersets a copy task will use</li>
  45. <li>add scoping rules for properties so that not all of them
  46. will be inherited by sub-builds, only those that have been
  47. specified explicitly. <i class="comment">Fill in details once
  48. they've been sorted out.</i></li>
  49. </ul>
  50. <p>The front-ends for Ant2 shall be smart enough to automatically
  51. detect the required libraries (like <code>tools.jar</code>), the
  52. use of native scripts shall be kept to a minimum.</p>
  53. <p>Build file writers can attach a message to targets that will be
  54. presented to the user if that target is going to be skipped (based
  55. on the if/unless attribute of the target).</p>
  56. <p>Even though Ant installation already is quite simple in Ant1
  57. (extract the archive and set two environment variables),
  58. alternative ways to install Ant like using
  59. <a href="http://java.sun.com/products/javawebstart/">Webstart</a> or
  60. a "self-extracting" JAR file will be explored.</p>
  61. <h2>Extensibility</h2>
  62. <p>Ant2 like Ant1 uses build files written in XML as its main
  63. input, but it will not be restricted to it. The core of Ant2 will
  64. work on an object model of Project/Target/Task that is independent
  65. of any external representation.</p>
  66. <p>As an extension of the current <code>&lt;taskdef&gt;</code>
  67. concept, tasks can be bundled into task libraries (together with
  68. data types and other utility classes). These task libraries are
  69. special JAR archives that somehow describe the contained tasks to
  70. Ant. Ant will automatically know all tasks contained in task
  71. libraries that have been placed into a special directory - in
  72. addition task libraries can be referenced and used in a build file
  73. explicitly. <i class="comment">Fill in details once they've been
  74. sorted out.</i></p>
  75. <p>It has become apparent, that several &quot;aspects&quot; of
  76. tasks are so common that task writers find themselves duplicating
  77. code all over again - things like classpath handling or &quot;do
  78. we stop the build if this task fails?&quot; functionality for
  79. example. Ant2 will provide a way to let the user attach an
  80. &quot;aspect handler&quot; to a project - all attributes that live
  81. in a certain namespace are going to be passed to this handler. <i
  82. class="comment">Need to talk about TaskContext here.</i></p>
  83. <p>Ant2 will farm out common functionality from tasks into utility
  84. classes so that task writers can benefit from a tested and stable
  85. framework - they shouldn't need to deal with existing tasks
  86. directly (like some tasks &quot;abuse&quot; the
  87. <code>&lt;touch&gt;</code> task in Ant1).</p>
  88. <p>Ant2 will provide a way to define tasks that itself can have
  89. tasks as child elements without knowing all defined tasks at
  90. compile time. Discussions on ant-dev usually talk about
  91. &quot;container tasks&quot; in this context.</p>
  92. <p>The only way to &quot;include&quot; common XML snippets so far
  93. has been the usage of external SYSTEM entities, a mechanism that
  94. is tied to DTDs and doesn't mix well with alternative
  95. approaches like XML Schema. Ant2 will provide a built-in include
  96. mechanism.</p>
  97. <h1>New/Modified Features</h1>
  98. <p>Ant2 will run the build process fully dynamically, which means
  99. that task won't be instantiated before they are actually being run
  100. and <code>${}</code> expansion will see the very latest value of a
  101. property. It will be possible to reassign values of properties via
  102. a built-in task.</p>
  103. <h2>Compatibility with Ant1</h2>
  104. <p>Ant2 is going to break Ant1 in several ways:</p>
  105. <ul>
  106. <li>Tasks written for Ant1 won't work in Ant2 as the API of
  107. Ant's core and the names of utility classes are going to
  108. change. There will probably be adaptors and utility classes to
  109. ease the transition for task writers.</li>
  110. <li>Build files written for Ant1 will probably not be valid in
  111. Ant2 or at least not yield the same results. It is expected that
  112. Ant2 will come with a tool to translate Ant1 build files into
  113. equivalent Ant2 versions</li>
  114. <li>magic properties like <code>build.compiler</code> may
  115. disappear and be replaced by a different customization
  116. concept.</li>
  117. <li>Ant2 is going to require a JDK version 1.2 or above and a
  118. JAXP compliant parser version 1.1 or above.</li>
  119. <li>If you specify more than one target in another target's
  120. depends attribute, Ant1 will execute these targets from left to
  121. right (as long as the dependency tree permits it) - Ant2 will
  122. not guarantee this behavior but will allow build file writers to
  123. specify the order explicitly.</li>
  124. </ul>
  125. <h2>Support Integration of Ant Into Other Tools</h2>
  126. <p>Ant2 will have a clear separation between the front-end that is
  127. responsible for user interactions, the object model that
  128. represents the project to build and the part of Ant that runs the
  129. build process itself <i class="comment">Name that TaskEngine,
  130. ProjectEngine, ExecutionEngine or what?</i>. This separation is
  131. expected to ease the integration of Ant (or parts of it) into
  132. other products.</p>
  133. <p>Ant2 itself will include a command line front-end and Antidote
  134. will become the GUI front-end to it. Other front-ends like a
  135. servlet front-end are expected <i class="comment">outside of
  136. Ant's core</i> as well.</p>
  137. <p>In addition to this separation, the following features should
  138. help people who want to integrate Ant into their products:</p>
  139. <ul>
  140. <li>It will be possible to cancel a running build process.</li>
  141. <li>Ant will detach from <code>System.err/.out/.in</code>
  142. completely and communicate with the front-end via a well defined
  143. API. The front-end will have to handle user input for tasks
  144. that need it (tasks that ask for a password for example).</li>
  145. <li>Tasks will provide some way to identify their attributes
  146. from the outside. <i class="default">fill in details</i></li>
  147. </ul>
  148. <h2>More Control for Users and Build File Writers</h2>
  149. <p>Ant2 will use a <code>BuildListener</code> concept similar to
  150. the one of Ant1 but may provide a richer set of events. It will be
  151. possible to attach and detach listeners to a build process from
  152. within the build file and to modify the behavior of attached
  153. listeners.</p>
  154. <p>In Ant1 users have little control over how things work. There
  155. are a couple of magic properties to make Ant chose a preferred
  156. compiler or modify the CLASSPATH, but they are barely documented.
  157. If users want to set these properties for every build process,
  158. they have to learn the undocumented tricks of the
  159. <code>ANT_OPTS</code> environment variable or the
  160. <code>~/.antrc</code> file.</p>
  161. <p>Ant2 will have a well defined system to specify user
  162. preferences. This system will not only let user chose their
  163. compiler but also give them a chance to provide default values for
  164. attributes (say you always want the <code>debug</code> attribute
  165. of the <code>javac</code> task to be true - unless it has been
  166. disabled explicitly). <i class="comment">Need to give details once
  167. they've been sorted out.</i></p>
  168. <h2>Documentation System</h2>
  169. <p>All tasks will be documented in XML files using a common DTD <i
  170. class="comment">Still need to define it</i> - task libraries are
  171. expected to include the documentation using this DTD inside the
  172. library itself.</p>
  173. <h2>Better Subbuild Handling</h2>
  174. <p class="comment">Is there something beyond &quot;should become
  175. better&quot; right now?</p>
  176. <h2>Data Types</h2>
  177. <p>Ant1 supports a limited set of data types (fileset, patternset
  178. and path) and at least up to Ant 1.3 it is not possible to
  179. register custom data types without writing a task that does this.
  180. Ant2 will provide a built-in mechanism to define new data
  181. types.</p>
  182. <p>Existing data-types will be improved, the files in a fileset
  183. can be chosen based on more than just pattern matching for example
  184. (modification time or permissions for example). Ant2 will have
  185. built-in tasks for set operations.</p>
  186. <p>Data types and properties will share the same name space and
  187. follow the same scoping and precedence rules.
  188. <i class="comment">${} again.</i></p>
  189. <h2>Multi-Threading of Tasks Within a Target</h2>
  190. <p>It will be possible to run several tasks in parallel - these
  191. tasks will belong to the same target and all tasks will be joined
  192. at the end of the target.</p>
  193. <h2>Internationalization</h2>
  194. <p>Ant2 itself will provide internationalized (error) messages and
  195. provide utility classes to help task writers to do the same.
  196. <i class="comment">These utility classes may very well come from a
  197. different (Jakarta) project</i>.</p>
  198. <p>Ant's primary language and the language of the build file
  199. will continue to be English.</p>
  200. <h1>Rejected Features</h1>
  201. <p>This is list is not complete, it just highlights some of the
  202. rejected features and tries to explain why they've been
  203. rejected. Two very common reasons to reject something were, that
  204. the request has been too vague or the same functionality could
  205. already be provided by some other accepted new feature.</p>
  206. <p>For a complete listing of all requested features, see <a
  207. href="requested-features.html">requested-features.html</a>. The
  208. discussion on all topics can be followed in the <a
  209. href="http://marc.theaimsgroup.com/?l=ant-dev&r=1&w=2">archives
  210. for ant-dev</a> in threads starting from 2001-03-21 - the subject
  211. lines contained either <code>[VOTE]</code> or
  212. <code>[DISC]</code>.</p>
  213. <h2>Simple Flow-Control</h2>
  214. <p>People asking for these kind of things have often heard the
  215. standard "Ant shall not become yet another scripting language, Ant
  216. shall not fall into the same traps make/Perl did ..." response
  217. from the committers and some long-term ant-dev people.</p>
  218. <p>The long version of that answer is:</p>
  219. <ul>
  220. <li>There are lots of open source scripting languages, there is
  221. no need to define a new one.</li>
  222. <li>Ant has been created to be a build tool. While you can use
  223. it for a whole lot of other things, this is not Ant's primary
  224. focus (and it shouldn't be). Most use-cases that ask for
  225. flow-control are out of Ant's scope.</li>
  226. <li>Ant already provides the requested functionality for many
  227. common situations. The execon and apply tasks can be used to
  228. iterate over a set of files as the (planed for Ant2) javaon and
  229. anton tasks will do.</li>
  230. <li>Providing flow-control inside Ant's core would increase the
  231. complexity of this core. This would make it difficult for new
  232. contributors to understand how Ant works and increase the
  233. maintenance cost for Ant at the same time. The goal of the Ant
  234. developers is to push as much complexity and functionality out
  235. of Ant's core into the tasks as possible.</li>
  236. </ul>
  237. <p>That being said, Ant2 will make it easy to write iteration or
  238. conditional tasks via the new container task concept. We expect
  239. foreach, switch and if tasks to be written, but they will probably
  240. not become core parts of the Ant distribution.</p>
  241. <h2>Advanced Conditionals for if/unless Attributes</h2>
  242. <p>The argument here is the same as for flow-control. We are
  243. talking about complexity that can be pushed from the core to tasks
  244. - and that is what will be done. Instead of additional power for
  245. the if/unless attributes, Ant2 will have a new task that can set
  246. properties based on the values of other properties or logical
  247. combinations of other conditions, something like (making up
  248. syntax):</p>
  249. <pre>
  250. &lt;condition name=&quot;javamail-complete&quot;&gt;
  251. &lt;and&gt;
  252. &lt;available class=&quot;javax.mail.Transport&quot;/&gt;
  253. &lt;available class=&quot;javax.activation.DataHandler&quot;/&gt;
  254. &lt;/and&gt;
  255. &lt;/condition&gt;
  256. </pre>
  257. <p>will become possible</p>
  258. <h2>Multi-Threaded Execution of Targets</h2>
  259. <p>The general feeling was, that the combination of target
  260. dependencies and multi-threading would soon become too complex,
  261. especially since Ant2 will allow people to explicitly enforce the
  262. order in which (independent) targets will be executed.</p>
  263. <p>This issue will be explored again later, it has not been
  264. rejected for all time being, but it is out of scope for
  265. Ant&nbsp;2.0</p>
  266. <h1>Ideas for New Tasks and Tools</h1>
  267. <p>Please refer to <a
  268. href="requested-features.html">requested-features.html</a> in the
  269. section &quot;I. Things that don't affect the core but are
  270. requests for new tasks or enhancements to existing tasks.&quot;
  271. for this.</p>
  272. <hr>
  273. <p align="center">$Id$</p>
  274. <p align="center">Copyright &copy; 2001 Apache Software
  275. Foundation. All rights Reserved.</p>
  276. </body>
  277. </html>