for (Iterator it = m_iterationList.iterator(); it.hasNext(); )
{
Iteration iteration = (Iteration)it.next();
List parameters = iteration.getParams();
Ant callee = new Ant(this);
callee.init();
callee.setAntfile(getProject().getProperty("ant.file"));
callee.setInheritAll(m_bInheritAll);
callee.setInheritRefs(m_bInheritRefs);
log("Executing task \"" + m_sTarget + "\" for:", Project.MSG_DEBUG);
// set properties to persist as Parameters
persistentState.restore(callee);
// set nested parameters
for (Iterator paramIt = parameters.iterator(); paramIt.hasNext(); )
{
Parameter param = (Parameter)paramIt.next();
Property calleeParam = callee.createProperty();
if (getProject().getProperty(param.getName()) != null)
{
log(" Overriding existing property \"" + param.getName() + "\".", Project.MSG_DEBUG);
}
log(" \"" + param.getName() + "\"=\"" + param.getValue() + "\".", Project.MSG_DEBUG);
calleeParam.setName(param.getName());
calleeParam.setValue(param.getValue());
}
callee.setTarget(m_sTarget);
try
{
// get Project handle
Project calleeNewProject = extractNewProject(callee);
//target execution
try
{
callee.execute();
}
catch (Exception exception)
{
handleException(exception);
}