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 16 KiB

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