ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <>
Subject <macrodef> What if an element isn't defined in a fileset?
Date Tue, 04 Sep 2007 18:45:50 GMT
I am using the <macrodef> task to define a macro that will help
standardize our building tasks. This is suppose to work better than
<antcall>, and I find some features very nice. However, I have a

I have something like this:

<macrodef name=build.module>
    <attribute name="module"/>
    <attribute jarname="@{module}.jar>
    <element name="configfiles" optional="true"/>

        <copy todir="${config.dir}">
            <fileset dir="${basedir}/@{module}">

This works fine as long as <configfiles/> is defined by the calling routine:

        <include name="config/**"/>

However, if the user doesn't define <configfiles/>, all files are
copied over which is what I don't want. How can I prevent this from
happening? Is there a way to see if <configfiles/> is defined?
David Weintraub

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message