Ant 文件集没有';我不支持;erroronmissingdir“;属性
我正在使用ant 1.7,出现以下错误: build.xml:55:fileset不支持“erroronmissingdir”属性 erroronmissingdir(在1.8中)在1.7中的替代属性是什么?erroronmissingdir属性从Ant 1.7.1开始就可用。您必须使用1.7的早期版本 该属性用于告诉生成以静默方式忽略在执行时不存在基本目录的文件集:Ant 文件集没有';我不支持;erroronmissingdir“;属性,ant,Ant,我正在使用ant 1.7,出现以下错误: build.xml:55:fileset不支持“erroronmissingdir”属性 erroronmissingdir(在1.8中)在1.7中的替代属性是什么?erroronmissingdir属性从Ant 1.7.1开始就可用。您必须使用1.7的早期版本 该属性用于告诉生成以静默方式忽略在执行时不存在基本目录的文件集: <copy todir="tmp"> <fileset dir="foo" erroronmissingd
<copy todir="tmp">
<fileset dir="foo" erroronmissingdir="false">
<include name="**/*"/>
</fileset>
</copy>
(注意,在这种情况下,副本现在将在copy
的todir
中创建dir foo。您可以使用glob将其剥离。)
另一种选择是在目标中执行有条件可用的文件集操作,由条件保护,例如
<available property="foo.available" file="foo"/>
<target name="test" if="foo.available">
<copy todir="tmp">
<fileset dir="foo">
<include name="**/*"/>
</fileset>
</copy>
</target>
<available property="foo.available" file="foo"/>
<target name="test" if="foo.available">
<copy todir="tmp">
<fileset dir="foo">
<include name="**/*"/>
</fileset>
</copy>
</target>
[available] Unable to find foo to set property foo.available
test: Skipped because property 'foo.available' not set.
BUILD SUCCESSFUL Total time: 0 seconds