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
Java 有没有一种方法可以使用ant有条件地复制文件?_Java_Ant - Fatal编程技术网

Java 有没有一种方法可以使用ant有条件地复制文件?

Java 有没有一种方法可以使用ant有条件地复制文件?,java,ant,Java,Ant,我有以下目标: <target name="promptforchoice"> <input addproperty="choice"> Copy the file?. [Y, n] </input> <condition property="copy.file"> <or> <equals arg1="Y" arg2="${choice}"/>

我有以下目标:

<target name="promptforchoice">

  <input addproperty="choice">
     Copy the file?.  [Y, n]
  </input>

    <condition property="copy.file">
        <or>
            <equals arg1="Y" arg2="${choice}"/>
            <equals arg1="y" arg2="${choice}"/>
        </or>
    </condition>

</target>

复制文件?。[Y,n]
在另一个目标中,我希望根据是否设置了copy.file属性有条件地复制文件这可能吗?还有其他方法可以实现吗


我的解决方案 这是我根据这个理论得出的结论


复制文件?。[Y,n]

谢谢

您可能需要以下内容:

<target name="mycopy" if="copy.file">
   <!-- do copy -->
</target>

<target name="mycopy" if="copy.file">
   <!-- do copy -->
</target>