Browse Source

MacroInstance: if owningtarget not set, use a default

MacroInstance: if id is as an attribute, check if this is in the
               macros attribute list and if not ignore


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275634 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 22 years ago
parent
commit
077ae8dc27
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      src/main/org/apache/tools/ant/taskdefs/MacroInstance.java

+ 11
- 1
src/main/org/apache/tools/ant/taskdefs/MacroInstance.java View File

@@ -68,6 +68,7 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DynamicConfigurator;
import org.apache.tools.ant.ProjectHelper;
import org.apache.tools.ant.RuntimeConfigurable;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.TaskContainer;
import org.apache.tools.ant.UnknownElement;
@@ -187,7 +188,13 @@ public class MacroInstance extends Task implements DynamicConfigurator {
ret.setQName(ue.getQName());
ret.setTaskName(ue.getTaskName());
ret.setLocation(ue.getLocation());
ret.setOwningTarget(getOwningTarget());
if (getOwningTarget() == null) {
Target t = new Target();
t.setProject(getProject());
ret.setOwningTarget(t);
} else {
ret.setOwningTarget(getOwningTarget());
}
RuntimeConfigurable rc = new RuntimeConfigurable(
ret, ue.getTaskName());
rc.setPolyType(ue.getWrapper().getPolyType());
@@ -256,6 +263,9 @@ public class MacroInstance extends Task implements DynamicConfigurator {
localProperties.put(attribute.getName(), value);
copyKeys.remove(attribute.getName());
}
if (copyKeys.contains("id")) {
copyKeys.remove("id");
}
if (copyKeys.size() != 0) {
throw new BuildException(
"Unknown attribute" + (copyKeys.size() > 1 ? "s " : " ")


Loading…
Cancel
Save