ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Dispatching based on property values
Date Thu, 18 Sep 2003 09:46:21 GMT
> > I'd like to know whether there are any alternatives being more
> > compact/elegant than the one I'm presenting here:
> 
> Slightly more compact, but should show a much better performance -
> unless I'm missing a reason to use antcall, that is:
> 
> > <target name="all" depends="eval_criteria">
> >   <antcall target="foo_rule"/>
> >   <antcall target="bar_rule"/>
> > </target>
> > 
> > <target name="foo_rule" if="foo">
> 
> replace with
> 
> <target name="all" depends="foo_rule,bar_rule"/>
> 
> <target name="foo_rule" if="foo" depends="eval_criteria">
> 
> and the same as last change with bar_rule.  Yes, the first target is
> empty.
> 
> Stefan


Oh, yes - the advantage here is that you avoid an <antcall> which opens
a new "namespace" for properties: properties set in the called target 
can not be accessed by the "parent" target (without bigger hacks ...)

The key is: the "all" target wants to do all. But the special targets
are executed only if their special property is set.
Here you can execute multiple targets: set "foo" AND "bar" :-)


Jan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message