No, this is currently not possible. <subant> uses <ant> behind the scene's,
and doesn't access the created project. Now, I've also hacked <antreturn>
that works for my own purpose, and does indeed get access to the child
project thru devious means, so in theory it could cache the child projects,
so I just don't think it's very advisable...

On the other hand, my goal with <antreturn> was to get back properties and
references from the child build, so you could get back up a property set in
a.xml, and feed it back down to c.xml and later to a.xml to avoid
reprocessing something. My own version of <subant> allows passing down a
<propertyset>, but I guess one could also have a return <propertyset> by
merging the <antreturn> functionality.

All this sounds very hackish though, even to me ;-)

Even my current use of <antReturn> I find hackish, but without the ability
to use Ant's own digester-like XML to Java engine, I find easier to call
another Project and extract what I need out of it, rather than coding from
scratch the info I need about of a separate non-Ant (data-type) file.

I hope I'm not too off base vis-à-vis your question. --DD

> -----Original Message-----
> From: Knut Wannheden [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 14, 2003 6:40 AM
> To: [EMAIL PROTECTED]
> Subject: can <subant> reuse Projects?
> 
> Hi,
> 
> Up until now I've been using my own <subant> like task.  But now that Ant
> 1.6 doesn't seem too distant anymore I'd like to integrate with <subant>.
> 
> There's one thing I'm wondering about: Can <subant> reuse the same Project
> object corresponding to a buildfile in multiple calls?  The reason that
> I'm
> askin this is that I think it would be nice if a target's dependencies
> were
> only resolved once.  Consider the following case:
> 
>          a.xml
>            ^
>          /   \
>     b.xml    c.xml
>        ^      ^
>         \    /
>          d.xml
> 
> where I in b.xml and c.xml use <subant> to invoke a target i a.xml.  And
> in
> d.xml i use <subant> to invoke a target in b.xml and c.xml.  Now if both
> b.xml and c.xml invoke the same target "foo" in a.xml, then I'd only want
> the dependencies of "a:foo" to be resolved once.
> 
> Is this currently possible with <subant> or would it be possible to add
> this
> behaviour?
> 
> --
> knut

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to