ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject RE: if and unless attributes for all Tasks
Date Fri, 18 May 2001 21:34:05 GMT
> From: ageo@mail.hereuare.com
>
> Jose Alberto Fernandez wrote:
>
> >
> > Maybe the problem is that you are abstracting your build
> the wrong way.
> > Why are you trying to put the ifs at the top level build file?
> >
> > In my opinion the top buildfile, should:
> >
> > (1) set properties for modules that do not need to be build.
> >     <property name="exclude.moduleX" value="true" />
> >
> > (2) call the corresponding top level target of all the modules:
> >     <ant dir="moduleX" target="build" />
> >     <ant dir="moduleY" target="build" />
> >     ....
> >
> > Each module build file default rule is of the form:
> >     <target name="build" ..... unless="exclude.moduleX" >
> >      ....
> >     </target>
> >
> > There is no need for 186 combinations or funny one liners.
> Is just putting
> > the burden of the decision on the right place.
> >
> > Jose Alberto
>
> The problem here is that I don't (or want to) know if a
> module is part of a
> CVS tag.  So in your example, item (2) would fail for each
> module that is not
> part of the CVS tag that I am building.  I can't predict
> which modules are
> part of a specific CVS tag.  If every module was a part of
> every CVS tag,
> your method would work.
>

So why isn't the buildfile versioned by the CVS tag just are the rest of the
system.

The buildfile root (the one not being versioned) should just get the CVS
version given the TAG and call the real buildfile with is part of the TAG
and therefore knows what modules are in that version of the product.

Alternatively (with the comming introduction of a way to loop on <ant*>
types of calls. Or using the <foreach> task someone posted, you can just
loop on all the module build files out there, and you will only build those
that exists in that particular version of the world. If they are not there
they will not be build.

This, I think, it is much more clean and easy to understant than ifs on
every tast. Which as I said before result in easy to write spaggetti code.

Jose Alberto



Mime
View raw message