The ant task'getProjectDirectory'
<pre>
<ant4eclipse:getProjectDirectory workspacedirectory="${workspace}"
projectname="simple.linked.project"
property="test" />
</pre>The ant condition 'hasNature'
<pre>
<antcontrib:if>
<ant4eclipse:hasNature workspacedirectory="${workspace}"
projectname="simple.java.project"
nature="org.eclipse.jdt.core.javanature" />
<antcontrib:then>
...
</antcontrib:then>
</antcontrib:if>
</pre>To check whether a given eclipse contains a specific build command or not, you can use ant4eclipse's hasBuildCommand condition.
<pre>
<antcontrib:if>
<ant4eclipse:hasBuildCommand workspacedirectory="${workspace}"
projectname="simple.java.project"
buildcommand="org.eclipse.jdt.core.javabuilder" />
<antcontrib:then>
...
</antcontrib:then>
</antcontrib:if>
</pre>executeBuildCommands
<pre>
<ant4eclipse:executeBuildCommands workspacedirectory="${workspace}"
projectname="simple.java.project">
<org.eclipse.jdt.core.javabuilder>
...
</org.eclipse.jdt.core.javabuilder>
</ant4eclipse:executeBuildCommands>
</pre>