2010-05-03 35 views

Respuesta

8

Realmente depende de lo que quiere decir con "diferencia sustancial". La diferencia sería que uno llama al otro, así que básicamente es lo mismo pero se usa en diferentes contextos.

Aquí hay un fragmento de defaults.properties que define las tareas Ant estándar:

ant=org.apache.tools.ant.taskdefs.Ant 
antcall=org.apache.tools.ant.taskdefs.CallTarget 
........... 

Si usted abre el código fuente de estas tareas se verá que CallTarget contiene un objeto y delega la mayor parte del trabajo a Ant it:

public class CallTarget extends Task { 
    private Ant callee; 
    ........... 
    ........... 
    /** 
    * Delegate the work to the ant task instance, after setting it up. 
    * @throws BuildException on validation failure or if the target didn't 
    * execute. 
    */ 
    public void execute() throws BuildException { 
     if (callee == null) { 
      init(); 
     } 
     if (!targetSet) { 
      throw new BuildException(
       "Attribute target or at least one nested target is required.", 
       getLocation()); 
     } 
     callee.setAntfile(getProject().getProperty("ant.file")); 
     callee.setInheritAll(inheritAll); 
     callee.setInheritRefs(inheritRefs); 
     callee.execute(); 
    } 
    .......... 
    .......... 
} 
Cuestiones relacionadas