Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 蚂蚁条件导入_Ant - Fatal编程技术网

Ant 蚂蚁条件导入

Ant 蚂蚁条件导入,ant,Ant,如果设置了属性,是否可以在ant的build.xml中导入文件,如果没有,则不导入 除了使用ant contrib if任务,还有其他方法吗 谢谢是的,你可以。 例如: <target name="importFile" depends="myProperty.check" if="myPropertyIsSet"> <echo>Import my file here</echo> </target> <target name="m

如果设置了属性,是否可以在ant的build.xml中导入文件,如果没有,则不导入

除了使用ant contrib if任务,还有其他方法吗

谢谢

是的,你可以。 例如:

<target name="importFile" depends="myProperty.check" if="myPropertyIsSet">
    <echo>Import my file here</echo>
</target>

<target name="myTarget.check">
    <condition property="myPropertyIsSet">
        <and>
            <!-- Conditions to check if my property is set. -->
        </and>
    </condition>
</target>

在这里导入我的文件

.

这不起作用。从ant 1.7开始,您不能在目标内部使用导入。这一定是最高级别的任务哎哟,我的错。另外,导入任务的可选属性对您来说还不够吗?