|
|
@@ -62,7 +62,7 @@ public class SubAnt |
|
|
|
private Path buildpath; |
|
|
|
|
|
|
|
private Ant ant = null; |
|
|
|
private String target = null; |
|
|
|
private String subTarget = null; |
|
|
|
private String antfile = "build.xml"; |
|
|
|
private File genericantfile = null; |
|
|
|
private boolean inheritAll = false; |
|
|
@@ -173,8 +173,8 @@ public class SubAnt |
|
|
|
} |
|
|
|
/* |
|
|
|
//REVISIT: there must be cleaner way of doing this, if it is merited at all |
|
|
|
if (target == null) { |
|
|
|
target = getOwningTarget().getName(); |
|
|
|
if (subTarget == null) { |
|
|
|
subTarget = getOwningTarget().getName(); |
|
|
|
} |
|
|
|
*/ |
|
|
|
BuildException buildException = null; |
|
|
@@ -267,14 +267,14 @@ public class SubAnt |
|
|
|
if (failOnError) { |
|
|
|
throw e; |
|
|
|
} |
|
|
|
log("Failure for target '" + target |
|
|
|
log("Failure for target '" + subTarget |
|
|
|
+ "' of: " + antfilename + "\n" |
|
|
|
+ e.getMessage(), Project.MSG_WARN); |
|
|
|
} catch (Throwable e) { |
|
|
|
if (failOnError) { |
|
|
|
throw new BuildException(e); |
|
|
|
} |
|
|
|
log("Failure for target '" + target |
|
|
|
log("Failure for target '" + subTarget |
|
|
|
+ "' of: " + antfilename + "\n" |
|
|
|
+ e.toString(), |
|
|
|
Project.MSG_WARN); |
|
|
@@ -326,7 +326,7 @@ public class SubAnt |
|
|
|
*/ |
|
|
|
// REVISIT: Defaults to the target name that contains this task if not specified. |
|
|
|
public void setTarget(String target) { |
|
|
|
this.target = target; |
|
|
|
this.subTarget = target; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -484,38 +484,38 @@ public class SubAnt |
|
|
|
* references necessary to run the sub-build. |
|
|
|
*/ |
|
|
|
private Ant createAntTask(File directory) { |
|
|
|
Ant ant = (Ant) getProject().createTask("ant"); |
|
|
|
ant.setOwningTarget(getOwningTarget()); |
|
|
|
ant.setTaskName(getTaskName()); |
|
|
|
ant.init(); |
|
|
|
if (target != null && target.length() > 0) { |
|
|
|
ant.setTarget(target); |
|
|
|
Ant antTask = (Ant) getProject().createTask("ant"); |
|
|
|
antTask.setOwningTarget(getOwningTarget()); |
|
|
|
antTask.setTaskName(getTaskName()); |
|
|
|
antTask.init(); |
|
|
|
if (subTarget != null && subTarget.length() > 0) { |
|
|
|
antTask.setTarget(subTarget); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (output != null) { |
|
|
|
ant.setOutput(output); |
|
|
|
antTask.setOutput(output); |
|
|
|
} |
|
|
|
|
|
|
|
if (directory != null) { |
|
|
|
ant.setDir(directory); |
|
|
|
antTask.setDir(directory); |
|
|
|
} |
|
|
|
|
|
|
|
ant.setInheritAll(inheritAll); |
|
|
|
antTask.setInheritAll(inheritAll); |
|
|
|
for (Enumeration i = properties.elements(); i.hasMoreElements();) { |
|
|
|
copyProperty(ant.createProperty(), (Property) i.nextElement()); |
|
|
|
copyProperty(antTask.createProperty(), (Property) i.nextElement()); |
|
|
|
} |
|
|
|
|
|
|
|
for (Enumeration i = propertySets.elements(); i.hasMoreElements();) { |
|
|
|
ant.addPropertyset((PropertySet) i.nextElement()); |
|
|
|
antTask.addPropertyset((PropertySet) i.nextElement()); |
|
|
|
} |
|
|
|
|
|
|
|
ant.setInheritRefs(inheritRefs); |
|
|
|
antTask.setInheritRefs(inheritRefs); |
|
|
|
for (Enumeration i = references.elements(); i.hasMoreElements();) { |
|
|
|
ant.addReference((Ant.Reference) i.nextElement()); |
|
|
|
antTask.addReference((Ant.Reference) i.nextElement()); |
|
|
|
} |
|
|
|
|
|
|
|
return ant; |
|
|
|
return antTask; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|