ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shatzer, Larry" <>
Subject antcall with macrodef
Date Tue, 14 Oct 2003 19:59:35 GMT
If your ant file contains antcall and you have macrodef's, and those
macrodefs have default attributes in the <attribute> element, it throws off
this warning:

Trying to override old definition of task <taskname here>

See attached ant file as an example:

<project basedir="." name="test" default="test">

  <macrodef name="test1">
    <attribute default="default value" name="test"/>
      <echo message="${test}"/>

  <macrodef name="test2">
    <attribute name="test"/>
      <echo message="${test}"/>

  <target name="test">
    <test1 test="this"/>
    <test2 test="that"/>
    <!-- Can't call <test2/> due to no default for macrodef test2 -->

  <target name="antcall-test">
    <antcall target="test"/>


run ant by itself, no errors or warnings, since antcall is never executed,
but if you run ant with antcall-test, you will see the warning.

Of course, macrodef gets rid of the need for antcall is almost all cases, I
still however have a few antcalls I need to keep, until I figure a way to
convert them to using macrodef, and this warning has been bugging me that
there was something else deeply wrong with 1.6, but as you can see, the
execution happens as expected.

-- Larry

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

View raw message