ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Holger Rauch <>
Subject Re: Depending on varying target using param inside antcall
Date Wed, 06 Sep 2006 11:19:08 GMT

I solved this problem like this (excerpt from my build file

1. The necessary macros (I'm using Ant 1.6.2)


      "set varying property"
      Set a generally named property whose name is available via @{propname}
      to the value of a more specifically named property whose name consists
      of @{propname}, but is prepended by a prefix, whose value is stored in
  <macrodef name="setvarprop">
    <attribute name="propprefix" default="NOT SET" />
    <attribute name="propname" default="NOT SET" />
      <property name="@{propname}" value="${@{propprefix}.@{propname}}" />

      "set multiple varying properties"
  <macrodef name="setmultvarprop">
    <attribute name="propprefix" default="NOT SET" />
    <attribute name="propnames" default="NOT SET" />
      <for param="currpropname"
	   delimiter=" ">
	  <setvarprop propprefix="@{propprefix}" propname="@{currpropname}"


2. The invocation and the corresponding echo lines in target "do-actual-test":


<property name="propnamelist" value="transformer.type
transformer.xml.input.file transformer.xsl.stylesheet
transformer.output.file transformer.xsl.stylesheet.params"  />
    <setmultvarprop propprefix="${config.prop.prefix}"
propnames="${propnamelist}" />
    <echo message="*** transformer.type = ${transformer.type}" />
    <echo message="*** transformer.xml.input.file =
${transformer.xml.input.file}" />
    <echo message="*** transformer.xsl.stylesheet =
${transformer.xsl.stylesheet}" />
    <echo message="*** transformer.output.file = ${transformer.output.file}"
    <echo message="*** transformer.xsl.stylesheet.params =
${transformer.xsl.stylesheet.params}" />


Hope this is of some help.

Kind regards,


View raw message