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>