且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

蚂蚁:如何比较两个文件的内容

更新时间:2022-01-09 16:26:43

您可以使用这样的:

<condition property="property" value="true">
  <filesmatch file1="file1"
              file2="file2"/>
</condition>

这将设置该属性只有当文件是相同的。
然后,您可以检查该属性,使用

This will set the property only if the files are the same. You can then check for the property, using

<target name="foo" if="property">
...
</target>

这是在蚂蚁提供,无添加的依赖,请参见这里其他条件。

This is available in ant, with no added dependency, see here for other conditions.