ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: IF task
Date Wed, 26 Mar 2003 16:43:29 GMT
On Wed, 26 Mar 2003, Antoine Levy-Lambert <levylambert@tiscali-dsl.de>
wrote:

> Could you explain why you think it is not likely that <if/> makes
> its way into ant-core from ant-contrib ?

If forced to - prepare for a long mail and probably an even longer
thread with some unpleasant words thrown around (not by me, promised -
it's just what usually happens when those questions don't go
unanswered 8-).

First of all, it is unlikely that we'll have any release with any new
features within the next two or three months at all.  Judging from the
release of Ant 1.5 - our last major release with new functionality -
it takes up to two months between the first beta and the final
release.  And I don't see us anywhere close to a 1.6beta right now.

I could try to escape the more difficult part of your question with
this.  I could also try to explain why I think that Ant should not be
abused as a scripting language, get beat for saying that and after a
long flame-fest disclose that I'm the author of ant-contrib's <if>
task.  Which option do you prefer?

OK, I'll try to answer seriously. ;-)

It is a little difficult to argue for me, as I'm not really strongly
opposed to the idea of adding them, even though I think it wouldn't be
a good idea.

The most important argument when we've discussed the "scripty" tasks
has been that having them in Ant's core will encourage their use.
Most of the time, people who want <if> tasks, are simply not aware of
the other options Ant offers.  They'll limit themselves.

Judging from some of the mails on this list, people might end up doing
this here

<foreach target="compile-it" param="file">
  <fileset dir="src" includes="**/*.java"/>
</foreach>

<target name="compile-it">
  <if>
    <uptodate>
      <srcfiles dir="src" includes="${file}"/>
      <mapper type="glob" from="*.java" to="dest/*.class"/>
    </uptodate>
    <else>
      <javac srcdir="src" destdir="dest" includes="${file}"/>
    </else>
  </if>
</target>

OK, I may be exaggerating, but I think you get the idea.

I realize that there are use-cases for <if> and <foreach> and maybe
even <switch>, but they are less common than generally claimed IMHO.
As I said, I'm the author of ant-contrib's <if> and apart from the
unit tests in ant-contrib, I've never written a build file that uses
it.

Let's make a list of pros and cons:

pro <if> (and friends?) inside Ant's distribution:

* easy to use the tasks

well, you avoid a single <taskdef> and a download.

con <if> (and friends?) inside Ant's distribution:

* adds more tasks to Ant

* couples <if>'s release cycle to that of Ant, while it may see more
  frequent releases outside of Ant

* may be used as what seems to be an easy solution to create
  unnecessarily complicated build files

> <IMHO> I feel that these features are desired by a lot of the users
> of ant, maybe by the majority. </IMHO>

If thought a long time on whether I should simply ignore this, add
fuel for another flame-war by deriving a political statement from this
by replacing "these features" and "users of ant" with different terms,
talk about the difference between meritocracy and democracy or ...

Let's say that the Ant committers have been standing against pressure
to add certain things for a long time.  Doing so has not done any harm
to Ant, quite the opposite IMHO as it has kept Ant as clean as it is
(which may not be that much).  We've had a time where adding support
for JavaScript evaluated expressions inside target's if attribute
seemed to be desired by a lot of users.

At the same time, I firmly believe that Ant committers are not
ignoring their user base.

People who really feel a strong need for <if> know where to find it.
Adding a single <taskdef> isn't hard to do.

Stefan

Mime
View raw message