ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27569] New: - macrodef implicit element
Date Wed, 10 Mar 2004 15:05:56 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27569>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27569

macrodef implicit element

           Summary: macrodef implicit element
           Product: Ant
           Version: 1.6.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: michael.prescott@ingenura.com


It would be great if macrodef could declare an implicit element if there is only
one element.  For example, I have need to do various things with hypersonic
running.  Macros make the tangle of parallel and sequential statements easy to
reuse, but without an implicit element, I have this silly-looking <do> element
in the usage:

<!-- usage -->
<withhypersonic>
  <do>
    <!-- do whatever -->
  </do>
</withhypersonic>

<!-- definition -->
<macrodef name="withhypersonic">
  <element name="do" optional="false"/>
  <sequential>
    <parallel>
      <dbstart/>
      <sequential>
        <waitfor>
          <socket server="localhost" port="${hypersonic.port}"/>
        </waitfor>

        <do/>

        <dbstop/>
      </sequential>
    </parallel>
  </sequential>
</macrodef>

The implicit element might work like this:

<!-- revised usage -->
<withhypersonic>
  <!-- do whatever -->
</withhypersonic>

<!-- revised definition -->
<macrodef name="withhypersonic">
  <element name="do" implicit="true"/>
  <sequential>
    <parallel>
      <dbstart/>
      <sequential>
        <waitfor>
          <socket server="localhost" port="${hypersonic.port}"/>
        </waitfor>

        <do/>

        <dbstop/>
      </sequential>
    </parallel>
  </sequential>
</macrodef>

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


Mime
View raw message