ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java CallTarget.java
Date Mon, 12 Mar 2001 09:22:07 GMT
bodewig     01/03/12 01:22:06

  Modified:    src/main/org/apache/tools/ant/taskdefs Ant.java
                        CallTarget.java
  Log:
  Make <antcall> and <ant> more Script-friendly.
  
  Revision  Changes    Path
  1.22      +1 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
  
  Index: Ant.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Ant.java	2001/01/03 14:18:29	1.21
  +++ Ant.java	2001/03/12 09:22:04	1.22
  @@ -205,6 +205,7 @@
               // Are we trying to call the target in which we are defined?
               if (p1.getBaseDir().equals(project.getBaseDir()) &&
                   p1.getProperty("ant.file").equals(project.getProperty("ant.file")) &&
  +                getOwningTarget() != null &&
                   target.equals(this.getOwningTarget().getName())) { 
   
                   throw new BuildException("ant task calling its own parent target");
  
  
  
  1.6       +6 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java
  
  Index: CallTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CallTarget.java	2001/01/03 14:18:29	1.5
  +++ CallTarget.java	2001/03/12 09:22:04	1.6
  @@ -82,6 +82,7 @@
   
       private Ant callee;
       private String subTarget;
  +    private boolean initialized = false;
   
       public void init() {
           callee = (Ant) project.createTask("ant");
  @@ -89,9 +90,14 @@
           callee.setTaskName(getTaskName());
           callee.setLocation(location);
           callee.init();
  +        initialized = true;
       }
   
       public void execute() {
  +        if (!initialized) {
  +            init();
  +        }
  +        
           if (subTarget == null) {
               throw new BuildException("Attribute target is required.", 
                                        location);
  
  
  

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


Mime
View raw message