ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject RE: how to check that a property exist
Date Thu, 12 Jun 2008 12:15:31 GMT

-----Original Message-----
From: []

Sent: Thursday, June 12, 2008 1:42 PM
Subject: RE: how to check that a property exist

Hi Gilbert,

issue ii) solved using macrodef:

  <target name="pollerEventIsSet-if" depends="check-pollerEventIsSet"
    <macrodef name="propertycopy">
      <attribute name="pollerEvent"/>
          <property name="pollerValue" value="${@{pollerEvent}}"/>
    <propertycopy pollerEvent="${IPEvent}.pollerManagedServer"/>
    <echo>pollerEventIsSet, pollerValue: ${pollerValue}</echo>


     [echo] pollerEventIsSet, pollerValue: bnk01alm01

Any idea about issue i) ?


issue ii) =
i believe that's solution which is also listed in the ant faq
as far as i remember

issue i)
the problem is you're using antcall which opens a new project scope
means after antcall is through the project scope is gone and you
don't get back anything to the calling target.

therefore tasks like AntCallBack, AntFetch exist in antcontrib ;-)

possible solutions =

very lowlevel = echo value to a file and load it in the calling target

thanks a lot for your hint but I would like to find a way without using
go with antcontrib - i see you're already using it, as propertycopy
is part of the antcontrib task suite ;-)))  and adapt my snippet to your

or finally - recommended -  use
check your existing properties etc. ...
set new properties you need for further processing via use of ant api

Regards, Gilbert

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

View raw message