ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Becky" <Becky.C...@core.fanniemae.com>
Subject RE: Need help for ["AntCall" cannot return properties]
Date Fri, 31 Oct 2003 00:09:37 GMT
Thanks everyone.  I got it to work by using target/depends, no AntCall.
Definitely I will request new resources to be added as suggested for a
long term resolution.
Here is how I did it.  Please let me know if you have better ideas.

Becky

(1) The problem:
================================
<target name="setup-properties">
     ...........
     <AntCall target="input-1"/> 
     <AntCall target="input-2"/> 
     <AntCall target="input-3"/> 
     <fail message="Missing input property" unless="small"/>
</target>
.....
<target name="A" if="input-1"
  <property name="small" value="a"/>
</target>
<target name="B" if="input-2"
  <property name="small" value="b"/>
</target>
<target name="C" if="input-3"
  <property name="small" value="c"/>
</target>


Running Ant from command line with various property name:
        Ant setup-properties -Dinput-1=
        Ant setup-properties -Dinput-2=
        Ant setup-properties -Dinput-3=

But the prpoerty defined in the target invoked by AntCall, won't be seen
outside of AntCall's taget.

(2) The fix:
====================
<target name="setup-properties" depends="set-small">
     .......................
     <fail message="Missing input property" unless="small"/>
</target>

<target name="set-small" depends="A,B,C"/>
<target name="A" if="input-1"
  <property name="small" value="a"/>
</target>
<target name="B" if="input-2"
  <property name="small" value="b"/>
</target>
<target name="C" if="input-3"
  <property name="small" value="c"/>
</target>



-----Original Message-----
From: Dale Anson [mailto:danson@germane-software.com] 
Sent: Thursday, October 30, 2003 6:23 PM
To: Ant Users List
Subject: Re: Need help for ["AntCall" cannot return properties]


I added the AntCallBack and AntFetch tasks from antelope to ant-contrib.

AntCallBack works like AntCall, but let's you get back some properties, 
and AntFetch does the same thing for the Ant task. You'd need to get 
them out of ant-contrib's cvs, as they are not in the current release. 
Ant-Contrib is at http://ant-contrib.sourceforge.net. Alternatively, you

can download the compiled tasks from the antelope project at 
http://antelope.sourceforge.net. The tasks are identical other than 
package name. Docs are on-line at 
http://antelope.sourceforge.net/manual/bk03.html.

Dale


Shatzer, Larry wrote:
> Have you looked around ant-contrib to see if they offer a task that 
> might suit you?
> 
> http://ant-contrib.sourceforge.net/
> 
> Particularly <if> and <switch>.
> 
> -- Larry
> 
> 
>>-----Original Message-----
>>From: Chen Becky [mailto:Becky.Chen@core.fanniemae.com]
>>Sent: Thursday, October 30, 2003 2:57 PM
>>To: user@ant.apache.org
>>Subject: Need help for ["AntCall" cannot return properties]
>>
>>
>>Hi,
>> 
>>Yes, I am new to ANT, may be you all are familiar with this. By 
>>researching from archive emails, I think the statement "AntCall cannot

>>return properties" is true. But there must be a way to setup a 
>>property to accomplish what I need to
>>do below.
>> 
>><-- I want to use AntCall to setup a property which based on another 
>>property with various name --> <AntCall target="input-1"/>
>><AntCall target="input-2"/>
>><AntCall target="input-3"/>
>>......
>>......
>><target name="A" if="input-1"
>>  <property name="small" value="a"/>
>></target>
>><target name="B" if="input-2"
>>  <property name="small" value="b"/>
>></target>
>><target name="C" if="input-3"
>>  <property name="small" value="c"/>
>></target>
>> 
>>Thanks a lot.
>>Becky
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


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




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


Mime
View raw message