我正在尝试检查 Phing 中是否存在目录或文件,但我什至无法获得基本的工作。
例如:
<project name="test" default="help" basedir="./">
<target name="clean" description="Deletes directory">
<available file="/testy" type="dir" property="dir.Exists" />
<if>
<isset property="dir.Exists"/>
<then>
<echo>Yep</echo>
</then>
</if>
</target>
<phingcall target="clean" />
</project>
我收到一个奇怪的错误:
Error reading project file [wrapped: \build.xml:22:18: Error initializing nested
element <echo> [wrapped: phing.tasks.system.IfTask doesn't support the 'echo'
creator/adder.]]
最终,如果目录存在,我想添加条件是/否以继续。
附言。据我所知,该错误与“嵌套元素回显”无关,因为如果我删除回显它仍然会发送相同的错误,实际上我认为这是与默认语法相关的错误消息或其他东西。