More todo list updates. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271708 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -613,153 +613,59 @@ attributes:</p> | |||||
| <tr><td> | <tr><td> | ||||
| <blockquote> | <blockquote> | ||||
| <p> | <p> | ||||
| The following table lists some of the current set of tasks. You can find | |||||
| example usages of these tasks in the sample project file | |||||
| <code>src/make/sample.ant</code>. | |||||
| Listed below are some of the current set of tasks. You can find example | |||||
| usages of these tasks in the sample project file <code>src/make/sample.ant</code>. | |||||
| </p> | </p> | ||||
| <table> | |||||
| <tr> | |||||
| <td bgcolor="#039acc" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Task | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#039acc" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Description | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| fail | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Causes the build to fail. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| if | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Conditionally executes a set of tasks. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| load-properties | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Loads a set of properties from a file. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| log | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Writes a log message. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| property | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Sets a property. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| try-catch | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Runs a set of tasks, with a provided error and clean-up handler. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| converter-def | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Register a type converter. These are used when configuring a task | |||||
| or data-type from attributes. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| type-def | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Register a task or data-type. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| import | |||||
| </font> | |||||
| </td> | |||||
| <td bgcolor="#a0ddf0" colspan="" rowspan="" | |||||
| valign="top" align="left"> | |||||
| <font color="#000000" size="-1" face="arial,helvetica,sanserif"> | |||||
| Register the contents of an antlib. | |||||
| </font> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| <h3><code><condition></code></h3> | |||||
| <p>Sets a property if a particular condition is true. See | |||||
| <a href="#Conditions">Conditions</a> for a list of available conditions.</p> | |||||
| <h3><code><fail></code></h3> | |||||
| <p>Causes the build to fail.</p> | |||||
| <h3><code><if></code></h3> | |||||
| <p>Conditionally executes a set of tasks.</p> | |||||
| <h3><code><load-properties></code></h3> | |||||
| <p>Loads a set of properties from a file.</p> | |||||
| <h3><code><log></code></h3> | |||||
| <p>Writes a log message.</p> | |||||
| <h3><code><property></code></h3> | |||||
| <p>Sets a property.</p> | |||||
| <h3><code><try-catch></code></h3> | |||||
| <p>Runs a set of tasks, with a provided error and clean-up handler.</p> | |||||
| <h3><code><converter-def></code></h3> | |||||
| <p>Register a type converter. These are used when configuring a task | |||||
| or data-type from attributes.</p> | |||||
| <h3><code><type-def></code></h3> | |||||
| <p>Register a task or data-type.</p> | |||||
| <h3><code><import></code></h3> | |||||
| <p>Register the contents of an antlib.</p> | |||||
| </blockquote> | |||||
| </td></tr> | |||||
| </table> | |||||
| <table border="0" cellspacing="0" cellpadding="2" width="100%"> | |||||
| <tr><td bgcolor="#525D76"> | |||||
| <font color="#ffffff" face="arial,helvetica,sanserif"> | |||||
| <a name="Conditions"><strong>Conditions</strong></a> | |||||
| </font> | |||||
| </td></tr> | |||||
| <tr><td> | |||||
| <blockquote> | |||||
| <p>The following conditions are available </p> | |||||
| <h3><code><and></code></h3> | |||||
| <p>Evaluates a set of nested conditions, and AND them together. Evaluation is | |||||
| lazy. An empty <code><and></code> condition evaluates to true.</p> | |||||
| <h3><code><available></code></h3> | |||||
| <p>Tests if a particular class or resource is available.</p> | |||||
| <h3><code><file-test></code></h3> | |||||
| <p>Tests a file against a set of <a href="vfs.html#File Selectors">file selectors</a>.</p> | |||||
| <h3><code><is-set></code></h3> | |||||
| <p>Tests whether a proeprty is set, and not set to 'false'.</p> | |||||
| <h3><code><or></code></h3> | |||||
| <p>Evaluates a set of nested conditions, and OR them together. Evaluation is | |||||
| lazy. An empty <code><or></code> evaluates to true.</p> | |||||
| <h3><code><os></code></h3> | |||||
| <p>Tests which operating system the build is running on.</p> | |||||
| <h3><code><not></code></h3> | |||||
| <p>Negates a nested condition.</p> | |||||
| </blockquote> | </blockquote> | ||||
| </td></tr> | </td></tr> | ||||
| </table> | </table> | ||||
| @@ -0,0 +1,232 @@ | |||||
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |||||
| <!-- Content Stylesheet for Site --> | |||||
| <!-- start the processing --> | |||||
| <html> | |||||
| <head> | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> | |||||
| <meta name="author" value="Peter Donald"> | |||||
| <meta name="email" value="peter@apache.org"> | |||||
| <title>Apache Myrmidon - Writing a task</title> | |||||
| </head> | |||||
| <body bgcolor="#ffffff" text="#000000" link="#525D76"> | |||||
| <table border="0" width="100%" cellspacing="0"> | |||||
| <!-- TOP IMAGE --> | |||||
| <tr> | |||||
| <td> <td colspan="2"> | |||||
| <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a> | |||||
| </td> | |||||
| </td> | |||||
| <td valign="bottom"><div align="right"><b><font size="+3" color="#525D76">Apache Myrmidon</font></b></div></td> | |||||
| </tr> | |||||
| </table> | |||||
| <table border="0" width="100%" cellspacing="4"> | |||||
| <tr><td colspan="2"> | |||||
| <hr noshade="" size="1"/> | |||||
| </td></tr> | |||||
| <tr> | |||||
| <!-- LEFT SIDE NAVIGATION --> | |||||
| <td valign="top" nowrap="true"> | |||||
| <p><strong>Myrmidon</strong></p> | |||||
| <ul> | |||||
| <li> <a href="./index.html">Introduction</a> | |||||
| </li> | |||||
| <li> <a href="./getinvolved.html">Get Involved</a> | |||||
| </li> | |||||
| <li> <a href="./user.html">Building Myrmidon</a> | |||||
| </li> | |||||
| <li> <a href="./todo.html">Todo List</a> | |||||
| </li> | |||||
| </ul> | |||||
| <p><strong>User Guide</strong></p> | |||||
| <ul> | |||||
| <li> <a href="./buildfile.html">Build file</a> | |||||
| </li> | |||||
| <li> <a href="./vfs.html">Virtual File System</a> | |||||
| </li> | |||||
| </ul> | |||||
| <p><strong>Extending Ant</strong></p> | |||||
| <ul> | |||||
| <li> <a href="./task.html">Task Writers HOWTO</a> | |||||
| </li> | |||||
| <li> <a href="./classloader.html">ClassLoader HOWTO</a> | |||||
| </li> | |||||
| <li> <a href="./librarys.html">Library HOWTO</a> | |||||
| </li> | |||||
| </ul> | |||||
| <p><strong>Container Design</strong></p> | |||||
| <ul> | |||||
| </ul> | |||||
| </td> | |||||
| <td align="left" valign="top"> | |||||
| <table border="0" cellspacing="0" cellpadding="2" width="100%"> | |||||
| <tr><td bgcolor="#525D76"> | |||||
| <font color="#ffffff" face="arial,helvetica,sanserif"> | |||||
| <a name="Writing a Task"><strong>Writing a Task</strong></a> | |||||
| </font> | |||||
| </td></tr> | |||||
| <tr><td> | |||||
| <blockquote> | |||||
| <p>In ant1 it was very easy to write your own task. In Ant2 we plan | |||||
| to make it even easier. To write a basic task simply follow the following | |||||
| formula.</p> | |||||
| <ol> | |||||
| <li> | |||||
| Create a Java class that extends | |||||
| <code>org.apache.myrmidon.api.AbstractTask</code> | |||||
| </li> | |||||
| <li> | |||||
| For each attribute, write a setter method. The setter method | |||||
| must be a public void method that takes a single argument. The name | |||||
| of the method must begin with "set", followed by the attribute name, with | |||||
| the first character of the name in uppercase, and the rest in lowercase. | |||||
| The type of the attribute can be: | |||||
| <ul> | |||||
| <li>String</li> | |||||
| <li> | |||||
| Any primitive type - they are converted for you from their | |||||
| String-representation in the buildfile | |||||
| </li> | |||||
| <li> | |||||
| File - the string representation will be interpreted relative to | |||||
| the project's basedir. | |||||
| </li> | |||||
| </ul> | |||||
| </li> | |||||
| <li> | |||||
| For each nested element create a public void method that takes a single | |||||
| argument. The name of the method must begin with "add", followed by the | |||||
| attribute name, with the first character of the name in uppercase, and | |||||
| the rest in lowercase. The type of the parameter is an object with a | |||||
| no-arguement constructor. It is configured in exactly the same was a | |||||
| task is configured (via setters and adders) and then added to the task. | |||||
| </li> | |||||
| <li> | |||||
| Write a public void method named "execute" with no arguments that | |||||
| throws a TaskException. This is the method called to do the | |||||
| actual work of the task. | |||||
| </li> | |||||
| </ol> | |||||
| <table border="0" cellspacing="0" cellpadding="2" width="100%"> | |||||
| <tr><td bgcolor="#828DA6"> | |||||
| <font color="#ffffff" face="arial,helvetica,sanserif"> | |||||
| <a name="A Basic Example"><strong>A Basic Example</strong></a> | |||||
| </font> | |||||
| </td></tr> | |||||
| <tr><td> | |||||
| <blockquote> | |||||
| <p>So a basic task that has one attribute named "message" and just prints | |||||
| out this message is as simple as;</p> | |||||
| <div align="left"> | |||||
| <table cellspacing="4" cellpadding="0" border="0"> | |||||
| <tr> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#ffffff"><pre> | |||||
| package org.realityforge.tasks; | |||||
| import org.apache.myrmidon.api.AbstractTask; | |||||
| import org.apache.myrmidon.api.TaskException; | |||||
| public class SystemOutPrinterTask | |||||
| extends Task | |||||
| { | |||||
| private String m_message; | |||||
| // The setter for the "message" attribute | |||||
| public void setMessage( final String message ) | |||||
| { | |||||
| m_message = message; | |||||
| } | |||||
| // The method executing the task | |||||
| public void execute() | |||||
| throws TaskException | |||||
| { | |||||
| System.out.println( m_message ); | |||||
| } | |||||
| } | |||||
| </pre></td> | |||||
| <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| <p>To use this task you <em>could</em> create a library but instead we will | |||||
| just use <taskdef> to define the task. An example usage would be;</p> | |||||
| <div align="left"> | |||||
| <table cellspacing="4" cellpadding="0" border="0"> | |||||
| <tr> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#ffffff"><pre> | |||||
| <?xml version="1.0"?> | |||||
| <project version="2.0"> | |||||
| <target name="main"> | |||||
| <taskdef name="printer" | |||||
| classname="org.realityforge.tasks.SystemOutPrinterTask" | |||||
| classpath="build/classes"/> | |||||
| <printer message="Hello World!"/> | |||||
| </target> | |||||
| </project> | |||||
| </pre></td> | |||||
| <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| </blockquote> | |||||
| </td></tr> | |||||
| </table> | |||||
| </blockquote> | |||||
| </td></tr> | |||||
| </table> | |||||
| </td> | |||||
| </tr> | |||||
| <!-- FOOTER --> | |||||
| <tr><td colspan="2"> | |||||
| <hr noshade="" size="1"/> | |||||
| </td></tr> | |||||
| <tr><td colspan="2"> | |||||
| <div align="center"><font color="#525D76" size="-1"><em> | |||||
| Copyright © 2000-2002, Apache Software Foundation | |||||
| </em></font></div> | |||||
| </td></tr> | |||||
| </table> | |||||
| </body> | |||||
| </html> | |||||
| <!-- end the processing --> | |||||
| @@ -159,12 +159,15 @@ | |||||
| <li>Add 'defaultexcludes' to <code>DefaultFileSet</code>. Also add a | <li>Add 'defaultexcludes' to <code>DefaultFileSet</code>. Also add a | ||||
| file selector implementation that matches everything except the default | file selector implementation that matches everything except the default | ||||
| excludes.</li> | excludes.</li> | ||||
| <li>Add a condition -> file selector adaptor, so that arbitrary conditions | |||||
| can be used to select files.</li> | |||||
| <li>Add a name selector that loads patterns from a file.</li> | <li>Add a name selector that loads patterns from a file.</li> | ||||
| <li>Add more selector implementations: size and last-modified comparisons, | <li>Add more selector implementations: size and last-modified comparisons, | ||||
| checksum comparison, byte-wise content comparison.</li> | checksum comparison, byte-wise content comparison.</li> | ||||
| </ul></li> | </ul></li> | ||||
| <li>File conditions: | |||||
| <ul> | |||||
| <li>Add more condition implementations that perform checks on files. | |||||
| One that searches a path for a file would be useful.</li> | |||||
| </ul></li> | |||||
| <li>File Name Mappers: | <li>File Name Mappers: | ||||
| <ul> | <ul> | ||||
| <li>Add a file name mapper interface, and port the current Mapper | <li>Add a file name mapper interface, and port the current Mapper | ||||
| @@ -190,15 +193,7 @@ | |||||
| an antlib, an installed extension, or the system classes of another JVM | an antlib, an installed extension, or the system classes of another JVM | ||||
| for cross-compiling).</li> | for cross-compiling).</li> | ||||
| </ul></li> | </ul></li> | ||||
| <li>File Filters: | |||||
| <ul> | |||||
| <li>Add a file filter interface, and use it in the copy task.</li> | |||||
| <li>Add a filter implementation that applies the token replacement that | |||||
| the old copy task provides.</li> | |||||
| <li>Add a filter that does cr/lf translation.</li> | |||||
| <li>Add a gzip/gunzip filter.</li> | |||||
| <li>Add a filter that applies character set encode/decode.</li> | |||||
| </ul></li> | |||||
| <li>Port across the Ant 1 file filter proposal, once it is complete.</li> | |||||
| <li>Copy task: | <li>Copy task: | ||||
| <ul> | <ul> | ||||
| <li>Implement 'preservelastmodified', 'overwrite', and 'includeemptydirs'.</li> | <li>Implement 'preservelastmodified', 'overwrite', and 'includeemptydirs'.</li> | ||||
| @@ -244,6 +239,27 @@ | |||||
| </ul> | </ul> | ||||
| </blockquote> | </blockquote> | ||||
| </td></tr> | </td></tr> | ||||
| </table> | |||||
| <table border="0" cellspacing="0" cellpadding="2" width="100%"> | |||||
| <tr><td bgcolor="#828DA6"> | |||||
| <font color="#ffffff" face="arial,helvetica,sanserif"> | |||||
| <a name="Scripting"><strong>Scripting</strong></a> | |||||
| </font> | |||||
| </td></tr> | |||||
| <tr><td> | |||||
| <blockquote> | |||||
| <p>Add the ability to extend Ant using languages other than | |||||
| Java:</p> | |||||
| <ul> | |||||
| <li>Define a task using a scripting language such as Javascript.</li> | |||||
| <li>Use Rhino's ability to implement Java interfaces, to | |||||
| implement and define types, such as FileSelector, or | |||||
| Condition.</li> | |||||
| <li>Define a task using template.</li> | |||||
| <li>Add some lightweight scripting tasks.</li> | |||||
| </ul> | |||||
| </blockquote> | |||||
| </td></tr> | |||||
| </table> | </table> | ||||
| <table border="0" cellspacing="0" cellpadding="2" width="100%"> | <table border="0" cellspacing="0" cellpadding="2" width="100%"> | ||||
| <tr><td bgcolor="#828DA6"> | <tr><td bgcolor="#828DA6"> | ||||
| @@ -309,6 +325,12 @@ | |||||
| <li>Detect duplicate type names.</li> | <li>Detect duplicate type names.</li> | ||||
| <li>Add fully qualified type names, based on antlib name and type shorthand name. | <li>Add fully qualified type names, based on antlib name and type shorthand name. | ||||
| Allow these to be used in build files in addition to the shorthand names.</li> | Allow these to be used in build files in addition to the shorthand names.</li> | ||||
| <li>Move the <code><http></code> and <code><socket></code> | |||||
| conditions to an antlib. Need to resolve how these will be passed a logger.</li> | |||||
| <li>Make the <code><uptodate></code> task a condition, and move to | |||||
| an antlib.</li> | |||||
| <li>Split up <code><is-set></code> condition into is-set and is-true conditions.</li> | |||||
| <li>Allow the <code><if></code> task to take any condition implementation.</li> | |||||
| <li>Unit tests.</li> | <li>Unit tests.</li> | ||||
| </ul> | </ul> | ||||
| </blockquote> | </blockquote> | ||||
| @@ -367,9 +367,13 @@ | |||||
| <h3><code><basename></code></h3> | <h3><code><basename></code></h3> | ||||
| <p>Selects files whose base name matches an Ant 1 style pattern, or a regular | <p>Selects files whose base name matches an Ant 1 style pattern, or a regular | ||||
| expression.</p> | expression.</p> | ||||
| <h3><code><condition></code></h3> | |||||
| <p>Takes a set of <a href="buildfile.html#Conditions">conditions</a>. If | |||||
| the conditions evaluate to true, then select every file. Otherwise, | |||||
| select no files.</p> | |||||
| <h3><code><exists></code></h3> | <h3><code><exists></code></h3> | ||||
| <p>Selects files that exist.</p> | <p>Selects files that exist.</p> | ||||
| <h3><code><is-empty></code></h3> | |||||
| <h3><code><is-empty-folder></code></h3> | |||||
| <p>Selects empty folders, that is, folders that have no children.</p> | <p>Selects empty folders, that is, folders that have no children.</p> | ||||
| <h3><code><is-folder></code></h3> | <h3><code><is-folder></code></h3> | ||||
| <p>Selects folders, does not select regular files.</p> | <p>Selects folders, does not select regular files.</p> | ||||
| @@ -206,53 +206,74 @@ attributes:</p> | |||||
| <section name="Tasks"> | <section name="Tasks"> | ||||
| <p> | <p> | ||||
| The following table lists some of the current set of tasks. You can find | |||||
| example usages of these tasks in the sample project file | |||||
| <code>src/make/sample.ant</code>. | |||||
| Listed below are some of the current set of tasks. You can find example | |||||
| usages of these tasks in the sample project file <code>src/make/sample.ant</code>. | |||||
| </p> | </p> | ||||
| <table> | |||||
| <tr><th>Task</th><th>Description</th></tr> | |||||
| <tr> | |||||
| <td>fail</td> | |||||
| <td>Causes the build to fail.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>if</td> | |||||
| <td>Conditionally executes a set of tasks.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>load-properties</td> | |||||
| <td>Loads a set of properties from a file.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>log</td> | |||||
| <td>Writes a log message.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>property</td> | |||||
| <td>Sets a property.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>try-catch</td> | |||||
| <td>Runs a set of tasks, with a provided error and clean-up handler.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>converter-def</td> | |||||
| <td>Register a type converter. These are used when configuring a task | |||||
| or data-type from attributes.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>type-def</td> | |||||
| <td>Register a task or data-type.</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>import</td> | |||||
| <td>Register the contents of an antlib.</td> | |||||
| </tr> | |||||
| </table> | |||||
| <h3><code><condition></code></h3> | |||||
| <p>Sets a property if a particular condition is true. See | |||||
| <a href="#Conditions">Conditions</a> for a list of available conditions.</p> | |||||
| <h3><code><fail></code></h3> | |||||
| <p>Causes the build to fail.</p> | |||||
| <h3><code><if></code></h3> | |||||
| <p>Conditionally executes a set of tasks.</p> | |||||
| <h3><code><load-properties></code></h3> | |||||
| <p>Loads a set of properties from a file.</p> | |||||
| <h3><code><log></code></h3> | |||||
| <p>Writes a log message.</p> | |||||
| <h3><code><property></code></h3> | |||||
| <p>Sets a property.</p> | |||||
| <h3><code><try-catch></code></h3> | |||||
| <p>Runs a set of tasks, with a provided error and clean-up handler.</p> | |||||
| <h3><code><converter-def></code></h3> | |||||
| <p>Register a type converter. These are used when configuring a task | |||||
| or data-type from attributes.</p> | |||||
| <h3><code><type-def></code></h3> | |||||
| <p>Register a task or data-type.</p> | |||||
| <h3><code><import></code></h3> | |||||
| <p>Register the contents of an antlib.</p> | |||||
| </section> | </section> | ||||
| <section name="Conditions"> | |||||
| <p>The following conditions are available </p> | |||||
| <h3><code><and></code></h3> | |||||
| <p>Evaluates a set of nested conditions, and AND them together. Evaluation is | |||||
| lazy. An empty <code><and></code> condition evaluates to true.</p> | |||||
| <h3><code><available></code></h3> | |||||
| <p>Tests if a particular class or resource is available.</p> | |||||
| <h3><code><file-test></code></h3> | |||||
| <p>Tests a file against a set of <a href="vfs.html#File Selectors">file selectors</a>.</p> | |||||
| <h3><code><is-set></code></h3> | |||||
| <p>Tests whether a proeprty is set, and not set to 'false'.</p> | |||||
| <h3><code><or></code></h3> | |||||
| <p>Evaluates a set of nested conditions, and OR them together. Evaluation is | |||||
| lazy. An empty <code><or></code> evaluates to true.</p> | |||||
| <h3><code><os></code></h3> | |||||
| <p>Tests which operating system the build is running on.</p> | |||||
| <h3><code><not></code></h3> | |||||
| <p>Negates a nested condition.</p> | |||||
| </section> | |||||
| </body> | </body> | ||||
| </document> | </document> | ||||
| @@ -74,12 +74,15 @@ | |||||
| <li>Add 'defaultexcludes' to <code>DefaultFileSet</code>. Also add a | <li>Add 'defaultexcludes' to <code>DefaultFileSet</code>. Also add a | ||||
| file selector implementation that matches everything except the default | file selector implementation that matches everything except the default | ||||
| excludes.</li> | excludes.</li> | ||||
| <li>Add a condition -> file selector adaptor, so that arbitrary conditions | |||||
| can be used to select files.</li> | |||||
| <li>Add a name selector that loads patterns from a file.</li> | <li>Add a name selector that loads patterns from a file.</li> | ||||
| <li>Add more selector implementations: size and last-modified comparisons, | <li>Add more selector implementations: size and last-modified comparisons, | ||||
| checksum comparison, byte-wise content comparison.</li> | checksum comparison, byte-wise content comparison.</li> | ||||
| </ul></li> | </ul></li> | ||||
| <li>File conditions: | |||||
| <ul> | |||||
| <li>Add more condition implementations that perform checks on files. | |||||
| One that searches a path for a file would be useful.</li> | |||||
| </ul></li> | |||||
| <li>File Name Mappers: | <li>File Name Mappers: | ||||
| <ul> | <ul> | ||||
| <li>Add a file name mapper interface, and port the current Mapper | <li>Add a file name mapper interface, and port the current Mapper | ||||
| @@ -105,15 +108,7 @@ | |||||
| an antlib, an installed extension, or the system classes of another JVM | an antlib, an installed extension, or the system classes of another JVM | ||||
| for cross-compiling).</li> | for cross-compiling).</li> | ||||
| </ul></li> | </ul></li> | ||||
| <li>File Filters: | |||||
| <ul> | |||||
| <li>Add a file filter interface, and use it in the copy task.</li> | |||||
| <li>Add a filter implementation that applies the token replacement that | |||||
| the old copy task provides.</li> | |||||
| <li>Add a filter that does cr/lf translation.</li> | |||||
| <li>Add a gzip/gunzip filter.</li> | |||||
| <li>Add a filter that applies character set encode/decode.</li> | |||||
| </ul></li> | |||||
| <li>Port across the Ant 1 file filter proposal, once it is complete.</li> | |||||
| <li>Copy task: | <li>Copy task: | ||||
| <ul> | <ul> | ||||
| <li>Implement 'preservelastmodified', 'overwrite', and 'includeemptydirs'.</li> | <li>Implement 'preservelastmodified', 'overwrite', and 'includeemptydirs'.</li> | ||||
| @@ -155,6 +150,19 @@ | |||||
| </subsection> | </subsection> | ||||
| <subsection name="Scripting"> | |||||
| <p>Add the ability to extend Ant using languages other than | |||||
| Java:</p> | |||||
| <ul> | |||||
| <li>Define a task using a scripting language such as Javascript.</li> | |||||
| <li>Use Rhino's ability to implement Java interfaces, to | |||||
| implement and define types, such as FileSelector, or | |||||
| Condition.</li> | |||||
| <li>Define a task using template.</li> | |||||
| <li>Add some lightweight scripting tasks.</li> | |||||
| </ul> | |||||
| </subsection> | |||||
| <subsection name="Documentation"> | <subsection name="Documentation"> | ||||
| <p>Everyone loves writing documentation, and so a goal for Ant 2 is to | <p>Everyone loves writing documentation, and so a goal for Ant 2 is to | ||||
| @@ -209,6 +217,12 @@ | |||||
| <li>Detect duplicate type names.</li> | <li>Detect duplicate type names.</li> | ||||
| <li>Add fully qualified type names, based on antlib name and type shorthand name. | <li>Add fully qualified type names, based on antlib name and type shorthand name. | ||||
| Allow these to be used in build files in addition to the shorthand names.</li> | Allow these to be used in build files in addition to the shorthand names.</li> | ||||
| <li>Move the <code><http></code> and <code><socket></code> | |||||
| conditions to an antlib. Need to resolve how these will be passed a logger.</li> | |||||
| <li>Make the <code><uptodate></code> task a condition, and move to | |||||
| an antlib.</li> | |||||
| <li>Split up <code><is-set></code> condition into is-set and is-true conditions.</li> | |||||
| <li>Allow the <code><if></code> task to take any condition implementation.</li> | |||||
| <li>Unit tests.</li> | <li>Unit tests.</li> | ||||
| </ul> | </ul> | ||||
| @@ -163,6 +163,12 @@ | |||||
| <p>Selects files whose base name matches an Ant 1 style pattern, or a regular | <p>Selects files whose base name matches an Ant 1 style pattern, or a regular | ||||
| expression.</p> | expression.</p> | ||||
| <h3><code><condition></code></h3> | |||||
| <p>Takes a set of <a href="buildfile.html#Conditions">conditions</a>. If | |||||
| the conditions evaluate to true, then select every file. Otherwise, | |||||
| select no files.</p> | |||||
| <h3><code><exists></code></h3> | <h3><code><exists></code></h3> | ||||
| <p>Selects files that exist.</p> | <p>Selects files that exist.</p> | ||||