ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Hudak" <charles.hu...@cardionet.com>
Subject Problems with macrodef in Ant 1.6.2
Date Tue, 17 Aug 2004 16:13:05 GMT
Hi,

I just upgraded to Ant 1.6.2 from 1.6.1 to take advantage of the junit
forkmode attribute. Now I am having problems with my macrodef's when I
try to invoke multiple targets on the command line. For instance, if I
invoke 'ant test dist' I get an error:

BUILD FAILED
C:\dev\common-util\build.xml:19: Element additional-properties  already
present

However, if I run a single target, e.g. 'ant test' or 'ant dist',
everything works fine.

I have a common build.xml file that is used by my other projects for
common build tasks and also allows extensions, via macros. The macro
that is causing the build to fail (I'm sure others would do the same is
this one:

<macrodef name=3D"set-properties">
    <element name=3D"additional-properties" optional=3D"true"/>
    <sequential>		=09
        <property name=3D"app.name" value=3D"${ant.project.name}" />
        <property name=3D"project.name" value=3D"${ant.project.name}" />

        <!-- rest of properties omitted for brevity -->

        <!-- Set additional properties -->
	  <additional-properties/>
    </sequential>
</macrodef>

I have a default task in the common build file that calls the macro:

<!--=20
    Default set-properties target; simply calls the macro. Users can
override to provide
    additional properties by overriding this target and invoking the
macro directly with the
    additional properties to set.
-->
<target name=3D"set-properties"=20
	  description=3D"Sets the build environment properties">
    <set-properties/>
</target>

In my other build scripts, I would override the set-properties task and
pass in additional properties to set by passing in additional properties
under the <additional-properties> element.

As I said, this configuration worked fine under 1.6.1 but is now failing
under 1.6.2 and I have no idea why. It looks like perhaps that the task
isn't being recycled correctly between build targets during the same
build invocation (I had a similar problem with Xdoclet that was a bug in
the Xdoclet task).

If anyone has any ideas or solutions I would greatly appreciate it.

Charles Hudak
Principle Software Engineer, Cardionet Inc.

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


Mime
View raw message