ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninju Bohra <ninju_bo...@yahoo.com>
Subject Re: How to preserve a property assigned via antcall on main build process?
Date Tue, 17 Oct 2006 02:09:39 GMT
David,

You may want to try the <antcallback> to bring back the value from a <antcall>

Later,

Ninju

----- Original Message ---- 
From: David <achepati67@yahoo.es> 
To: Ant Apache User Group <user@ant.apache.org> 
Sent: Monday, October 16, 2006 11:30:17 AM 
Subject: How to preserve a property assigned via antcall on main build process? 


Dear members, 

I am figthing for avoiding to use <if> from ant contrib lib, but I guess for solving
this problem there is no other solution. 

I have the following targets: 

<target name="target" depends="target-pre" 
unless ="target.skip"> 
... 
</target> 

Note: From working properly this target I need to compute the property target.var.value (and
this property could be assigned previoulsy if some target needed such property before) 

Now 

<target name="target-pre" unless ="target.var.value"> 
<antcall target="compute-target1.var1"/> 
<property name="target.var1.value" value="the value is: ${target.var}"/> 
</target> 

This is the best solution, but the problem comes from the fact that the property computed
on target compute-target1.var (property target.var) is not assigned after antcall invokation,
so it doesn't work. 

but If I use instead of antcall, just dependences I get the value of target.var properly 

<target name="target-pre" unless ="target.var" 
depends="compute-target.var"> 
<property name="target.var.value" value="the value is: ${target.var}"/> 
</target> 

what I don't like about this solution is that the dependences targets are ALWAYS execute even
if the property target.var was defined or not. This is a simple case, but on my case the computation
of target.var is a complex task, so I have to run it always. 

Using ant contrib it is inmidiatly using <if> task, but I don't want to add more library
dependence to my project. 

Do you have any idea about how to solve this problem? 

Thanks, 

David 


--------------------------------- 
Do you Yahoo!? 
Get on board. You're invited to try the new Yahoo! Mail.



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


Mime
View raw message