仅基于条件运行的ant目标
可能重复:仅基于条件运行的ant目标,ant,Ant,可能重复: 我只想在特定目录中不存在一些jar的情况下构建ant目标编译junit,我该怎么做?BuildJUnit中的ie compile junit目标应仅在目录project/jarlocation/dcs中不存在jar文件时运行。与我注释的类似内容略有不同。要在不存在时运行,请将“如果”替换为“除非”: <target name="check-abc"> <available file="abc.txt" property="abc.present"/&g
我只想在特定目录中不存在一些jar的情况下构建ant目标编译junit,我该怎么做?BuildJUnit中的ie compile junit目标应仅在目录project/jarlocation/dcs中不存在jar文件时运行。与我注释的类似内容略有不同。要在不存在时运行,请将“如果”替换为“除非”:
<target name="check-abc">
<available file="abc.txt" property="abc.present"/>
</target>
<target name="do-unless-abc" depends="check-abc" unless="abc.present">
...
</target>
...
这看起来像是您可以检查的答案。该文件夹不存在
<target name="check-abc">
<available file="abc.txt" property="abc.present"/>
</target>
<target name="do-unless-abc" depends="check-abc" unless="abc.present">
...
</target>