ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Taylor <donald_l_taylor...@yahoo.com>
Subject RE: Properties not set properly after <antcall>
Date Wed, 27 Jun 2001 12:28:00 GMT
In general, your "workaround" is standard operating procedure. However,
someday you may find that you *really* do need to make an antcall and
that you *really* need to propagate the the properties from the caller
to the callee. Stefan says this is impossible, I claim he isn't devious
enough!  :)

Here's my idea:

<target name="callee">
  <!-- Let's set some properties for the caller -->
  <propertyfile file="callee.properties">
    <entry key="callee.property1" value="value1"/>
    <entry key="callee.property2" value="value2"/>
  </propertyfile>
</target>

<target name="caller">
  <antcall target="callee"/>
  <property file="callee.properties"/>
</target>


Here you see 'caller' calls 'callee', who defines properties and stores
them in a property file, and that on return 'caller' can read those
properties from the file.

Note that propertyfile is an optional task.

-- don

--- Jamie Lawrence <jamie.lawrence@broadcom.ie> wrote:
> Thanks.  The workaround for me is to place those targets in the init
> attribute. i.e,
> 
> <target name="all" description="Compile all code, all versions and
> deploy"
> depends="pc,palm">
> </target>
>  
> Now, "ant all compile" works fine.  Perhaps the <antcall> or
> <property>
> documentation could be updated to explain this issue.
> 
> 	Jamie
> 
> 
> > -----Original Message-----
> > From: Stefan Bodewig [mailto:bodewig@apache.org]
> > Sent: 27 June 2001 11:10
> > To: ant-user@jakarta.apache.org
> > Subject: Re: Properties not set properly after <antcall>
> > 
> > 
> > Jamie Lawrence <jamie.lawrence@broadcom.ie> wrote:
> > 
> > > Why do properties in a target only get set if the target is
> called
> > > from the cmd-line or init, but aren't set when called using
> antcall?
> > 
> > They are set, but only for the duration of the antcall.  When you
> use
> > <antcall>, you get a copy of your current project and work on that
> -
> > there is no way to feed back information from that copy to your
> > original project.
> > 
> > Stefan
> > 
> 
> 

> ATTACHMENT part 2 application/octet-stream name=Jamie Lawrence
(E-mail).vcf



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Mime
View raw message