Bug 55885 - if:set attribute failing on macrodef invocation
Summary: if:set attribute failing on macrodef invocation
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.9.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: 1.9.3
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-14 22:38 UTC by Antoine Levy-Lambert
Modified: 2013-12-15 03:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Levy-Lambert 2013-12-14 22:38:52 UTC
On Dec 9, 2013, at 9:22 AM, Steele, Richard wrote:

I can't seem to get the new if: and unless: attributes working on uses of
macrodef.  For example:

<project name="conditional-tests" xmlns:if="ant:if"
xmlns:unless="ant:unless">

   <macrodef name="sayhi">
       <sequential>
           <echo>hi</echo>
       </sequential>
   </macrodef>


   <target name="hi">
       <sayhi if:set="verbose" />
   </target>

</project>

If I do "ant hi" from the command line the script runs to completion, and
as expected, there's no output:

C:\conditional-tests>ant hi
Buildfile: C:\conditional-tests\build.xml

hi:

BUILD SUCCESSFUL

However, if I set the property I get an error:

C:\conditional-tests>ant hi -Dverbose=x
Buildfile: C:\conditional-tests\build.xml

hi:

BUILD FAILED
C:\Development\projects\ant-playground\conditional-tests\build.xml:11:
Unknown attribute [ant:if:if:set]

Thoughts?

Rich
Comment 1 Antoine Levy-Lambert 2013-12-15 03:47:54 UTC
fixed in revision 1550999