ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Jennings <m...@southgatesoftware.com>
Subject Re: new Task subclass
Date Wed, 21 Jul 2004 16:09:12 GMT
> Ok here is the argument about being not such a good idea (in general).
> 1) For every contition you need to test in the whole of your buildfile
> you need to come up with yet another property that will be use for
> testing it.
> 
> 2) Then you need to make sure that all your properties have been tested,
> 
> and those that are not defined because of the test, will never be
> defined later
> by some other part of your build.
> 
> In escence, it is noce for small things, but for large builds it becomes
> a real nightmare.
> 
> What other competing stuff is out there:
> 
> a) Use <if> from antcontrib (more to the point: convice enough comitters
> to 
> get <if> and such inside core, since some people do not like importing
> 3rd parties
> for such basic functionality. The people against claim is too verbose.
> 
> b) Some have proposed the idea of an evaluation language that can be
> used
> inside the if/unless attributes. That would allow expressing conplex
> conditions
> without needing to define properties for each one of them. Also means a
> language must be defined or adopted and it must have enough expressing
> power.
 
> All this things do not exclude one another, but before we embark on some
> direction
> we need to think about what will be best for readability,
> maintenability, etc.
> 
> Jose Alberto

Thanks for the explanation Jose! I understand the problem with coming up
unique property names just to use in an if= or unless=.
Why not use 2 approaches? In my opinion

<target name="debugstuff" if="debugmode">
...
</target>

is quite readable and I would not want to give that up. But using just
the existence/nonexistence of a property is useful only in particular
instances. Trying to use that approach for all conditional behaviour
is a bad idea. Having the <if> task as a core task seems an obvious
and good idea to me. That being said, being able to embed

<echo if="debugmode">
You are compiling in debug mode
</echo>

in the middle of a target (without having to make multiple targets)
would be pretty cool also.




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


Mime
View raw message