ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: ant/docs/manual/CoreTasks macrodef.html
Date Tue, 20 Apr 2004 14:53:12 GMT
jhm         2004/04/20 07:53:12

  Modified:    docs/manual/CoreTasks Tag: ANT_16_BRANCH macrodef.html
  Log:
  Merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.2.2.14  +81 -8     ant/docs/manual/CoreTasks/macrodef.html
  
  Index: macrodef.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/macrodef.html,v
  retrieving revision 1.2.2.13
  retrieving revision 1.2.2.14
  diff -u -r1.2.2.13 -r1.2.2.14
  --- macrodef.html	25 Feb 2004 11:34:22 -0000	1.2.2.13
  +++ macrodef.html	20 Apr 2004 14:53:12 -0000	1.2.2.14
  @@ -1,27 +1,32 @@
   <html>
  -  
  +
     <head>
       <meta http-equiv="Content-Language" content="en-us"></meta>
       <title>MacroDef Task</title>
  -<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
  +    <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
       <style type="text/css">
         <!--
              .code { background: #EFEFEF; margin-top: }
              -->
       </style>
     </head>
  -    
  +
     <body>
  -      
  +
       <h2><a name="macrodef">MacroDef</a></h2>
       <h3>Description</h3>
       <p>
  -      This defines a new task using a &lt;sequential&gt; 
  +      This defines a new task using a &lt;sequential&gt;
         nested task as a template. Nested elements &lt;attribute&gt; and
         &lt;element&gt; are used to specify attributes and elements of
         the new task. These get substituted into the  &lt;sequential&gt;
         task when the new task is run.
       </p>
  +    <h3>Note</h3>
  +    <p>
  +      You can also use <i>prior defined</i> attributes for default-values in
  +      other attributes. See the examples.
  +    </p>
       <p>
         <em>since Ant 1.6</em>
       </p>
  @@ -184,7 +189,55 @@
           <td valign="top" align="center">No</td>
         </tr>
       </table>
  -    
  +    <h4>text</h4>
  +    <p>
  +      This is used to specify the treatment of text contents of the macrodef.
  +      If this element is not present, then any nested text in the macro
  +      will be an error. If the text element is present, then the name
  +      becomes an attribute that gets set to the nested text of the macro.
  +      <em>Since ant 1.6.1.</em>
  +    </p>
  +    <p>
  +      The case of the text name is ignored.
  +    </p>
  +    <h3>Parameters</h3>
  +    <table border="1" cellpadding="2" cellspacing="0">
  +      <tr>
  +        <td valign="top"><b>Attribute</b></td>
  +        <td valign="top"><b>Description</b></td>
  +        <td align="center" valign="top"><b>Required</b></td>
  +      </tr>
  +      <tr>
  +        <td valign="top">name</td>
  +        <td valign="top">The name of the text attribute</td>
  +        <td valign="top" align="center">Yes</td>
  +      </tr>
  +      <tr>
  +        <td valign="top">optional</td>
  +        <td valign="top">
  +          If true nested text in the macro is optional, default is "false".
  +        </td>
  +        <td valign="top" align="center">No</td>
  +      </tr>
  +      <tr>
  +        <td valign="top">trim</td>
  +        <td valign="top">
  +          If true, the nested text is trimmed of white space,
  +          default is "false".
  +        </td>
  +        <td valign="top" align="center">No</td>
  +      </tr>
  +      <tr>
  +        <td valign="top">description</td>
  +        <td valign="top">
  +          This contains a description
  +          informing the user what the nested text of the macro is expected
  +          to be.
  +        </td>
  +        <td valign="top" align="center">No</td>
  +      </tr>
  +    </table>
  +
       <h3>Examples</h3>
       <p>
         The following example defined a task called testing and
  @@ -267,10 +320,30 @@
   &lt;/echotest&gt;
   </pre>
       </blockquote>
  +    <p>
  +      The following uses a prior defined attribut for setting the
  +      default value of another. The output would be
  +      <tt>one=test two=test</tt>. If you change the order of lines
  +      *1 and *2 the output would be <tt>one=test two=@{one}</tt>,
  +      because while processing the <i>two</i>-line the value for
  +      <i>one</i> is not set.
  +    </p>
  +    <blockquote>
  +<pre class="code">
  +&lt;macrodef name="test"/&gt;
  +   &lt;attribute name="one"/&gt;                     <b>*1</b>
  +   &lt;attribute name="two" default="@{one}"/&gt;    <b>*2</b>
  +   &lt;sequential&gt;
  +      &lt;echo&gt;one=@{one}   two=@{two}&lt;/echo&gt;
  +   &lt;/sequential&gt;
  +&lt;/macrodef/&gt;
  +&lt;test one="test"/&gt;
  +</pre>
  +>>>>>>> 1.14
  +    </blockquote>
   <hr>
   <p align="center">Copyright &copy; 2003-2004 The Apache Software
   Foundation. All rights Reserved.</p>
   
   </body>
  -</html>
  -
  +</html>
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message