我想做这样的事情
<target name="init" description="Create build directories.
>
<mkdir dir="bin" />
<mkdir dir="dist" />
<!-- Check for the presence of dependent JARs -->
<condition property="dependent.files.available">
<and>
<available file="../../xx.jar" />
<available file="../../yy.jar" />
</and>
</condition>
</target>
<!--- Compile -->
<target name="compile" depends="init" description="Compile java sources
and create classes">
<if>
<isset property="dependent.files.available"/>
<then>
<javac srcdir="src" destdir="bin" classpathref="ext_jar_classpath"/>
</then>
<else>
<echo message="Either xx.jar or yy.jar not found"/>
</else>
</if>
</target>
当我尝试编译代码时,它给了我以下错误
Problem: failed to create task or type if
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place
这是正确的做法吗?