ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs MacroInstance.java
Date Thu, 13 Nov 2003 18:12:24 GMT
peterreilly    2003/11/13 10:12:24

  Modified:    src/main/org/apache/tools/ant/taskdefs MacroInstance.java
  Log:
  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
  
  Revision  Changes    Path
  1.9       +11 -1     ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
  
  Index: MacroInstance.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- MacroInstance.java	6 Nov 2003 14:57:10 -0000	1.8
  +++ MacroInstance.java	13 Nov 2003 18:12:24 -0000	1.9
  @@ -68,6 +68,7 @@
   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 @@
           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());
  @@ -255,6 +262,9 @@
               }
               localProperties.put(attribute.getName(), value);
               copyKeys.remove(attribute.getName());
  +        }
  +        if (copyKeys.contains("id")) {
  +            copyKeys.remove("id");
           }
           if (copyKeys.size() != 0) {
               throw new BuildException(
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message