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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]]
> > Sent: 27 June 2001 11:10
> > To: [EMAIL PROTECTED]
> > Subject: Re: Properties not set properly after <antcall>
> > 
> > 
> > Jamie Lawrence <[EMAIL PROTECTED]> 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/

Reply via email to