ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: Problems with <import>
Date Sat, 20 Jul 2002 16:41:45 GMT

Dominique Devienne wrote:
> Why can we just add two attributes to <project>, similar to 'default', which
> specifies the 'first', and 'last' target of the build? Both these attributes
> would be optional. I think it makes things pretty expressive:
> 
> <project name="antx"
>          default="build"
>          first="init"
>          last="finally">

...

> Now the question would be whether targets defined as being the 'first' and
> 'last' targets should be allowed to have dependencies on other target
> themselves (a 'depends' attribute basically). 

...

> Having a 'last' target is not
> equivalent to append the 'last' target to all targets 'depends' attribute.
> It has to run *after* the target, not *just before* the target. It's more
> equivalent to an <antcall target="'last'"/>. I'm thinking maybe the 'last'
> target shouldn't be allowed a 'depends' attribute.

This is exactly why we should use special tags for them.

<project name="antx"
           default="build">

   <init><!-- no attributes allowed, ie no depends, no name, etc -->
     ...
   </init>

   <target name="">
     ...
   </target>

   <finally><!-- no attributes allowed, ie no depends, no name, etc -->
     ...
   </finally>
</project>

Init and Finally are not targets, they are just sequences of tasks.
Targets have dependencies, can be invoked by name.
This is why I favor using new tags, to make the semantics more evident 
and clean.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message