|
@@ -80,27 +80,7 @@ public class UnknownElement extends Task { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void maybeConfigure() throws BuildException { |
|
|
public void maybeConfigure() throws BuildException { |
|
|
realTask = project.createTask(elementName); |
|
|
|
|
|
if (realTask == null) { |
|
|
|
|
|
log("Could not create task of type: " + elementName + " Common solutions" + |
|
|
|
|
|
" are adding the task to defaults.properties and executing bin/bootstrap", |
|
|
|
|
|
Project.MSG_DEBUG); |
|
|
|
|
|
throw new BuildException("Could not create task of type: " + elementName + |
|
|
|
|
|
". Common solutions are to use taskdef to declare" + |
|
|
|
|
|
" your task, or, if this is an optional task," + |
|
|
|
|
|
" to put the optional.jar in the lib directory of" + |
|
|
|
|
|
" your ant installation (ANT_HOME).", location); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
realTask.setLocation(location); |
|
|
|
|
|
String id = wrapper.getAttributes().getValue("id"); |
|
|
|
|
|
if (id != null) { |
|
|
|
|
|
project.addReference(id, realTask); |
|
|
|
|
|
} |
|
|
|
|
|
realTask.init(); |
|
|
|
|
|
|
|
|
|
|
|
// UnknownElement always has an associated target |
|
|
|
|
|
realTask.setOwningTarget(target); |
|
|
|
|
|
|
|
|
realTask = makeTask(this, wrapper); |
|
|
|
|
|
|
|
|
wrapper.setProxy(realTask); |
|
|
wrapper.setProxy(realTask); |
|
|
realTask.setRuntimeConfigurableWrapper(wrapper); |
|
|
realTask.setRuntimeConfigurableWrapper(wrapper); |
|
@@ -135,16 +115,58 @@ public class UnknownElement extends Task { |
|
|
if (parent instanceof TaskAdapter) { |
|
|
if (parent instanceof TaskAdapter) { |
|
|
parent = ((TaskAdapter) parent).getProxy(); |
|
|
parent = ((TaskAdapter) parent).getProxy(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Class parentClass = parent.getClass(); |
|
|
Class parentClass = parent.getClass(); |
|
|
IntrospectionHelper ih = IntrospectionHelper.getHelper(parentClass); |
|
|
IntrospectionHelper ih = IntrospectionHelper.getHelper(parentClass); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<children.size(); i++) { |
|
|
for (int i=0; i<children.size(); i++) { |
|
|
UnknownElement child = (UnknownElement) children.elementAt(i); |
|
|
|
|
|
Object realChild = ih.createElement(project, parent, child.getTag()); |
|
|
|
|
|
RuntimeConfigurable childWrapper = parentWrapper.getChild(i); |
|
|
RuntimeConfigurable childWrapper = parentWrapper.getChild(i); |
|
|
|
|
|
UnknownElement child = (UnknownElement) children.elementAt(i); |
|
|
|
|
|
Object realChild = null; |
|
|
|
|
|
if (parent instanceof TaskContainer) { |
|
|
|
|
|
realChild = makeTask(child, childWrapper); |
|
|
|
|
|
((TaskContainer) parent).addTask((Task) realChild); |
|
|
|
|
|
} else { |
|
|
|
|
|
ih.createElement(project, parent, child.getTag()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
childWrapper.setProxy(realChild); |
|
|
childWrapper.setProxy(realChild); |
|
|
|
|
|
if (realChild instanceof Task) { |
|
|
|
|
|
((Task) realChild).setRuntimeConfigurableWrapper(childWrapper); |
|
|
|
|
|
} |
|
|
child.handleChildren(realChild, childWrapper); |
|
|
child.handleChildren(realChild, childWrapper); |
|
|
|
|
|
if (realChild instanceof Task) { |
|
|
|
|
|
((Task) realChild).maybeConfigure(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Create a named task and configure it up to the init() stage. |
|
|
|
|
|
*/ |
|
|
|
|
|
protected Task makeTask(UnknownElement ue, RuntimeConfigurable w) { |
|
|
|
|
|
Task task = project.createTask(ue.getTag()); |
|
|
|
|
|
if (task == null) { |
|
|
|
|
|
log("Could not create task of type: " + elementName + " Common solutions" + |
|
|
|
|
|
" are adding the task to defaults.properties and executing bin/bootstrap", |
|
|
|
|
|
Project.MSG_DEBUG); |
|
|
|
|
|
throw new BuildException("Could not create task of type: " + elementName + |
|
|
|
|
|
". Common solutions are to use taskdef to declare" + |
|
|
|
|
|
" your task, or, if this is an optional task," + |
|
|
|
|
|
" to put the optional.jar in the lib directory of" + |
|
|
|
|
|
" your ant installation (ANT_HOME).", location); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
task.setLocation(getLocation()); |
|
|
|
|
|
String id = w.getAttributes().getValue("id"); |
|
|
|
|
|
if (id != null) { |
|
|
|
|
|
project.addReference(id, task); |
|
|
|
|
|
} |
|
|
|
|
|
// UnknownElement always has an associated target |
|
|
|
|
|
task.setOwningTarget(target); |
|
|
|
|
|
|
|
|
|
|
|
task.init(); |
|
|
|
|
|
return task; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}// UnknownElement |
|
|
}// UnknownElement |