ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject RE: if and unless attributes for all Tasks
Date Wed, 16 May 2001 05:24:01 GMT
> From: Peter Donald [mailto:donaldp@apache.org]
>
> if you mean the ant-calls for src and bianry distributions then I agree -
> UGLY ;) Though it is better than any alternative I could think of - you ?

True enough. I think we are using these antcalls primarily as a way to get
around the immutable properties in Ant - right? So, I see these resulting
from another Ant "feature". We solve that problem using the tools at hand -
antcall.

It is the same with if and unless. Those are the tools we have provided and
a lot of problems can be solved that way, but sometimes it forces the build
writer into unnatural contortions. The end result is that the build file is
complex and the intent of the build file's author is lost. Compare Jose
Alberto's target based example against the original in the patch. It works
in the current Ant, but is it better?

I like this discussion since we should always be ready to question whether
there is a better way of doing things. That is why I'd like to hear from Jon
on his thoughts for a better way of doing the uptodate checks. uptodate is a
direct result of the if/unless mechanisms we currently have. Is there a
better way?

>
> >Is writing tasks the right way? I'm not sure that is true.
>
> Could you explain why? ie What do you see wrong with writing a task for
> complex build "tasks".

I see tasks as appropriate when you tend to do the same type of things in
many places or in many builds. That is, I see them as a solution when you
can apply them in multiple places. I'm wary of using tasks for ad-hoc
conditional requirements in the build. Can you see a task or tasks for the
Ant build that handles all the conditionals we currently have. Look at the
<exclude> elements in the compilation. Moving that into its own task would
make the build much more difficult to understand. At one extreme it would
become
<buildant>

:-)

>
> If you are referring to the initial setting of properties and general
> autoconf-like features then I agree that writing a task is
> overkill as most
> tests will be project specific. (I believe autoconf should be written in
> some scripting language like jython/rhino or another BSF mounted scripting
> language). However for the other stuff I think task writing is
> the WAY to go.
>

So, why don't we use that in the ant build file? WOuld it be better, more
easily maintained? I'm not convinced.

BTW, I'm not arguing for any particular view. I'm not sure what is the best
compromise, myself.

Conor


Mime
View raw message