ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@us.ibm.com
Subject Re: [RFE] Richer Task Specification
Date Mon, 26 Jun 2000 14:45:10 GMT


Stefan wrote:
> If it was only for the taskdef case that started all this, I
> still think a depends attribute like Matt suggested would have
> been the best solution.

Would have?  Don't give up!

Let's explore the depends approach for a moment.  Here's an example where
all the non-structural information is removed for clarity:

<project default="main">
  <taskdef depends="bootstrap" />
  <target name="prep" />
  <target name="bootstrap" depends="prep"/>
  <target name="main" depends="prep"/>
</project>

Given this example, a build of main will result in the following order:
   prep
   bootstrap
   taskdef
   main

What concerns me is that we are going from a simple ordering scheme for
targets based on the specification of a single desired outcome to a scheme
where the ordering of targets can be influenced by multiple implicit
sources.  This is complexity.  I'm not so much concerned about the
implementation, but the implications where a small change to a large
build.xml file will produce unexpected (albeit fully explainable) results.

> But I'm really intrigued by the idea of buildfiles without targets.
> We might even attract users that never used any text based build
> tools at all.

;-)

> Something inside of me says "only allow tasks outside of targets
> if there are no targets at all" but that's probably too confusing
> - especially to new users.

Now that I do not like.  Imagine the transition.  Initially I develop a
build file that casually intermixes javac and taskdef.  When I get to the
point where I want to introduce a second target, I need to completely
reorganize my build file and become painfully aware of the distinction
between the two.

If we believe that users should be aware of the distinction between
javac-like things (tasks), and taskdef-like things (declarations), then we
shouldn't encourage people to develop bad habits to begin with.  I would
also go a step further, and suggest that if we go this way, there should be
an obvious visual distinction between the two - just looking at the XML,
they both look too similar to me.

I still do a fair amount of development in C (not C++, C).  One of the
biggest things I miss is the ability to put declarations where I think they
make sense.  All things considered, and given that we have a valid use case
(bootstrapping taskdefs), I prefer unification.

- Sam Ruby



Mime
View raw message