ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Uther <will+...@cs.cmu.edu>
Subject Subtasks within tasks
Date Fri, 25 Feb 2000 01:07:08 GMT
Hi,
  The current ANT allows you to have properties within tasks, and these can
be arbitrarily nested, but each one requires a createXxxx() method to
return an object that goes along with that XML property.  This means you
can't have general sub-Tasks.  You'd have to make a createXxxx() method for
each task - not feasable.

  So, I've implemented some changes that allow arbirary sub-Tasks.  There
is a new interface: SubTaskable which has an addSubTask(Task) method.  When
a property is encountered for which there is no createXxxx() method, the
element is checked to see if it implements SubTaskable.  If it does then a
task with the appropriate name is created and added using the
addSubTask(Task) method.

  To keep things clean I also modified Target and Task slightly.  Target
now implements SubTaskable.  The Task.setTarget(Target) has been changed to
Task.setTarget(SubTaskable).  I also deprecated the Target.addTask(Task)
method.  It does the same thing as the new addSubTask(Task) method.  I
didn't use addTask(Task) in the SubTaskable interface because that might
conflict with an attribute.  With it's two capitals, addSubTask() cannot.

  I've attached diffs for ProjectHelper.java, Task.java and Target.java.
I've attached the complete SubTaskable.java.  I've also attached a task,
SubTaskTest.java, that simply executes each of its subtasks in order.

later,

\x/ill       :-}

Mime
View raw message