答案 0 :(得分:8)
这实际上取决于“实质性差异”的含义。区别在于一个人调用另一个,所以基本上是相同的东西,但在不同的上下文中使用。
以下是来自defaults.properties
的片段,它定义了标准的Ant任务:
ant=org.apache.tools.ant.taskdefs.Ant
antcall=org.apache.tools.ant.taskdefs.CallTarget
...........
如果您打开这些任务的源代码,您会看到CallTarget
包含Ant
个对象,并将大部分工作委托给它:
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();
}
..........
..........
}