You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2007/09/12 15:39:23 UTC

DO NOT REPLY [Bug 43362] New: - Add conditional attributes

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=43362>.
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=43362

           Summary: Add conditional attributes
           Product: Ant
           Version: unspecified
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: peterreilly@apache.org


This patch allows conditional attributes to be
used to suppress evaluation of unknown elements.
This has the effect of adding conditional execution for
tasks and conditon inclusion of nested elements.

Example usage:
<project name="x" xmlns:if="ant:if" xmlns:unless="ant:unless">

  <property name="onWindows" value="true"/>

  <target name="abc">
       <echo if:set="onWindows">I am on windows</echo>
       <echo unless:set="onWindows">I am *not* on windows</echo>
  </target>
  <macrodef name="mycommand">
     <attribute name="level" default=""/>
     <attribute name="debug" default=""/>
      <attribute name="file"/>
    <sequential>
       <exec executable="mycommand">
       <arg value="--debug"  if:true="@{debug}"/>
       <arg value="--level"    unless:blank="@{level}"/>
       <arg value="@{level}"  unless:blank="@{level}"/>
       <arg value="@{file}"/>
  </sequential>
 </macrodef>

</project>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 43362] - Add conditional attributes

Posted by bu...@apache.org.
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=43362>.
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=43362





------- Additional Comments From peterreilly@apache.org  2007-09-12 06:40 -------
Created an attachment (id=20797)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20797&action=view)
Patch against trunk providing the functionaly and some tests


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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