Browse Source

Replace the UE with the task as soon as the task is constructed.

This allows Script tasks to work in most cases- and any other task that
requires Task in the tree.

It is the current behavior - but I think it is not the best solution.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273618 13f79535-47bb-0310-9956-ffa450edef68
master
Costin Manolache 22 years ago
parent
commit
869b5253ea
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      proposal/embed/src/java/org/apache/tools/ant/UnknownElement2.java

+ 6
- 0
proposal/embed/src/java/org/apache/tools/ant/UnknownElement2.java View File

@@ -150,11 +150,17 @@ public class UnknownElement2 extends UnknownElement {
task.setOwningTarget(this.getOwningTarget()); task.setOwningTarget(this.getOwningTarget());
task.init(); task.init();
task.setRuntimeConfigurableWrapper(getWrapper2()); task.setRuntimeConfigurableWrapper(getWrapper2());

// For Script to work. Ugly
// The reference is replaced by RuntimeConfigurable
this.getOwningTarget().replaceChild(this, (Task)realThing);
} }


handleChildren(realThing, getWrapper2()); handleChildren(realThing, getWrapper2());


getWrapper2().maybeConfigure(getProject()); getWrapper2().maybeConfigure(getProject());


} }


/** /**


Loading…
Cancel
Save