tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@m64.com>
Subject RE: Ant
Date Sat, 11 Dec 1999 14:37:01 GMT
> > > - Change Project.java: if a "init" target is defined, that will be
> > > executed allways
> > > before anything else.
> > > All <property/> and <defaultProperties/> defines will be here.
> > > A good ideea would be to have TaskDef in the init section too ( with a
> > > TaskDef task ).
> >
> > Let's keep things simple. Look at this pseudo-DTD
> >
> > <!ENTITY % init 'properties|property'>
> > <!ELEMENT project ((%init;)*, target+)>
> >
> > everything that is before the targets gets executed before the target.
>
> The problem is that ProjectHelper needs to be changed to add anything
> before target.
>
> You may have more things to do to init - besides setting properties.
> ( taskdef is one - probably in time we will discover other )
>
> With <target name=init> it is even simpler - you no longer have property
> as a special case, everything follow the same pattern

> project=collection of
> targets,
> each target= collection of actions).
>

I know the discussion has moved on from here but I like the concept of the
init entity. Whilst using an "init" target may be easier to implement and
the project is nicely reduced to just a collection of targets, you are
making one of those targets special. You are hardcoding that "specialness"
rather than capturing it in the XML structure. "init" becomes a special
target name which someone using ant must remember. What if they added a
"depends" attribute to the init target? Making init an entity makes it
specialness obvious to the build.xml author.

What do you think?

Conor


Mime
View raw message