ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
Subject Re: [RFE] Richer Task Specification
Date Tue, 27 Jun 2000 07:29:45 GMT
>>>>> "sr" == rubys  <rubys@us.ibm.com> writes:

 sr> 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.

 sr> Would have?  Don't give up!

Just some kind of language confusion I guess, german and english verb
forms don't always line up very well and when in doubt I tend to get
it wrong.

"would be the best solution" seems more appropriate.

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

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

 sr> What concerns me is that we are going from a simple ordering
 sr> scheme for targets based on the specification of a single desired
 sr> outcome to a scheme where the ordering of targets can be
 sr> influenced by multiple implicit sources.

The depends attribute of taskdef looks quite explicit to me. I cannot
write down that example without the depends attribute at all.

<project default="main"> 
  <tasks from the bootstrap target of your example - how do we satisfy
         the depends="prep" part?>
  <taskdef /> 
  <target name="prep" /> 
  <target name="main" depends="prep"/> 
</project>

Closest would be

<project default="main"> 
  <tasks from the prep target of your example>
  <tasks from the bootstrap target of your example>
  <taskdef /> 
  <target name="main" /> 
</project>

And the prep target is gone as well.

 >> 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.

 sr> Now that I do not like.

I didn't say I'd be fond of it myself. I see that this would make the
learning curve of Ant a "learning jump" at one point.

Your example leads to another transition though. If I start moving
tasks out of my targets I might need to restructure my whole
buildfile. But of course I don't need to move tasks to the same level
as targets - as long as taskdef gains a depends attribute ;-).

 sr> If we believe that users should be aware of the distinction
 sr> between javac-like things (tasks), and taskdef-like things
 sr> (declarations), then we shouldn't encourage people to develop bad
 sr> habits to begin with.

Agreed - you could remove the "if" part and we'd still agree though.

Stefan

Mime
View raw message