我正在使用此脚本来计算文件的md5
<?xml version="1.0"?>
<project name="Hello World Project" basedir="." default="checkChecksum">
<property name="cms.dir" value="D:\CMS\webclient\WebContent" />
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<target name="createChecksum">
<checksum todir="./checksum">
<fileset dir="${cms.dir}"/>
</checksum>
<echo>Hello World - Welcome to Apache Ant!</echo>
<fileset id="src.files" dir="${cms.dir}" casesensitive="yes">
<include name="**/*.uim"/>
<include name="**/*.properties"/>
</fileset>
<pathconvert pathsep="${line.separator}" property="sounds" refid="src.files">
</pathconvert>
<echo file="sounds.txt">${sounds}</echo>
<loadfile property="files" srcFile="./sounds.txt"/>
<for list="${files}" delimiter="${line.separator}" param="file1">
<sequential>
<echo>@{file1}</echo>
</sequential>
</for>
</target>
</project>
有没有办法得到修改过的文件名,我的意思是md5不匹配?
答案 0 :(得分:1)
可以使用ANT selector完成。
<project name="name" default="print-modified">
<target name="print-modified">
<apply executable="echo">
<srcfile/>
<fileset dir="src">
<modified/>
</fileset>
</apply>
</target>
</project>
注意: