我想用ANT比较两个文件(比如file1.txt,file2.txt)的内容.
如果文件内容相同则应将某些"property"设置为true,如果内容不相同则应将"property"设置为false.
任何人都可以建议我任何可以做到这一点的ANT任务.
提前致谢.
ton*_*nio 11
您可以使用以下内容:
<condition property="property" value="true">
<filesmatch file1="file1"
file2="file2"/>
</condition>
Run Code Online (Sandbox Code Playgroud)
仅当文件相同时才会设置属性.然后,您可以使用检查房产
<target name="foo" if="property">
...
</target>
Run Code Online (Sandbox Code Playgroud)
这在ant中可用,没有额外的依赖性,请参阅此处了解其他条件.
| 归档时间: |
|
| 查看次数: |
9435 次 |
| 最近记录: |