You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by pr...@wipro.com on 2005/10/20 16:15:31 UTC

Usage of antcall

I am trying to use antcall, I had a property file called admin.size in
which value admin=136374, I can't put this property file admin.size
ouside of create-zip target.

<target name="create-zip" description="Generates the zip files">
	
		<property file="admin.size"/>
		<move file="Admin.zip"
tofile="${common.name}${today.date}${admin.name}${admin}.zip"/>
		<mkdir
dir="${today.date}/${common.name}${today.date}${admin.name}${admin}"/>
	
	</target>
	<target name="splitte-zip">
		<antcall target="create-zip"/>
		<java classname="Helper" fork="yes" failonerror="true">
			<arg value="-break[10240]"/>
			<arg
value="${common.name}${today.date}${admin.name}${admin}.zip"/>
			<arg
value="${today.date}/${common.name}${today.date}${admin.name}${admin}"/>
		</java>
	</target>


gives error:
     [java] Error opening input file: java.io.FileNotFoundException:
OCC_20051020_PAdmin_${admin}.zip (The system cannot find the file
specified)

   can anyone guess what I am doing wrong, and how I should use antcall,

Pritesh



Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

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


Re: Usage of antcall

Posted by Dominique Devienne <dd...@gmail.com>.
>   can anyone guess what I am doing wrong, and how I should use antcall,

The short answer is to not use <antcall>, but target dependencies
instead, and more specifically, the depends attribute of <target>.
--DD

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


Re: Usage of antcall

Posted by Ninju Bohra <ni...@yahoo.com>.
The slightly longer answer...

The problem is that at a high-level every <antcall>
invokes an new private "ANT" environment.  Any
properties that are defined inside that new private
"ANT" enviroment are not copied back out to the
orignating "ANT" enviroment.

Your property ${admin} is loaded inside a private
"ANT" enviroment and so its visible/lifetime is
limited to that enviroment.

By using a depends= attribute (or a <macrodef>
technique) on starting target you retain the original
ANT enviroment through all the ANT targets and so all
properties definitions are retained.

Hope that helps

--- pritesh.saharey@wipro.com wrote:

> 
> I am trying to use antcall, I had a property file
> called admin.size in
> which value admin=136374, I can't put this property
> file admin.size
> ouside of create-zip target.
> 
> <target name="create-zip" description="Generates the
> zip files">
> 	
> 		<property file="admin.size"/>
> 		<move file="Admin.zip"
>
tofile="${common.name}${today.date}${admin.name}${admin}.zip"/>
> 		<mkdir
>
dir="${today.date}/${common.name}${today.date}${admin.name}${admin}"/>
> 	
> 	</target>
> 	<target name="splitte-zip">
> 		<antcall target="create-zip"/>
> 		<java classname="Helper" fork="yes"
> failonerror="true">
> 			<arg value="-break[10240]"/>
> 			<arg
>
value="${common.name}${today.date}${admin.name}${admin}.zip"/>
> 			<arg
>
value="${today.date}/${common.name}${today.date}${admin.name}${admin}"/>
> 		</java>
> 	</target>
> 
> 
> gives error:
>      [java] Error opening input file:
> java.io.FileNotFoundException:
> OCC_20051020_PAdmin_${admin}.zip (The system cannot
> find the file
> specified)
> 
>    can anyone guess what I am doing wrong, and how I
> should use antcall,
> 
> Pritesh
> 
> 
> 
> Confidentiality Notice
> 
> The information contained in this electronic message
> and any attachments to this message are intended
> for the exclusive use of the addressee(s) and may
> contain confidential or privileged information. If
> you are not the intended recipient, please notify
> the sender at Wipro or Mailadmin@wipro.com
> immediately
> and destroy all copies of this message and any
> attachments.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 






	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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