taskdef
元素将 cobertura.jar 文件限定在当前工作目录中:todir
属性指定将测量类放到什么地方。fileset
子元素指定测量哪些 .class 文件name="instrument" depends="report">
todir="${instrumented.dir}">
dir="${pro.build.path}">
name="**/*.class" />
name="**/*Test.class" />
name="cover-test" depends="instrument">
dir="${testreportdir}" />
dir="./" failureproperty="test.failure" printSummary="yes" fork="true" haltοnerrοr="true">
<classpath< span="" style="word-wrap: break-word;">location="cobertura.jar" />
<classpath< span="" style="word-wrap: break-word;">location="instrumented" />
dir="lib">
name="**/*.jar" />
path="${pro.build.path}" />
path="${pro.build.path}" />
todir="${pro.build.path}">
dir="src/main/test">
name="**/*Test.java" />
name="coverage-report" depends="cover-test">
srcdir="src/main/java" destdir="instrumented" />
name="mkzip" depends="coverage-report">
destfile="report/html/test-result${ant.project.name}.zip">
dir="report/html">
name="**/*.html" />
name="**/*.css" />
name="**/*.txt" />
destfile="report/html/cover-test-result${ant.project.name}.zip">
dir="instrumented">
name="**/*.html" />
name="**/*.css" />
name="**/*.txt" />
name="**/*.png" />
name="**/*.js" />
name="mail" depends="mkzip">
mailhost="smtp.126.com" mailport="25" subject="The Build Test" user="用户名" password="邮箱密码">
address="你的发信地址" name="Danlley Wei" />
dir="report/html">
name="**/test-result${ant.project.name}.zip" />
name="**/cover-test-result${ant.project.name}.zip" />
address="收信人地址" name="Danlley Wei" />
The ${pro.name}--${pro.author} has been tested !
The ${pro.name}--${pro.author} has been tested !