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 43362] New: - Add conditional attributes
Date Wed, 12 Sep 2007 13:39:23 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=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


Mime
View raw message