您的位置:首页 > 移动开发 > Android开发

How to do android emma coverage test in your own ant scipts

2012-04-27 12:18 525 查看
引用:http://www.cnitblog.com/reene/archive/2011/06/30/74504.html1. emma taskdef <!-- Emma configuration -->

<property name="emma.dir" value="${android.sdk.root}/tools/lib" />

<path id="emma.lib.dir">

<pathelement location="${emma.dir}/emma.jar" />

<pathelement location="${emma.dir}/emma_ant.jar" />

</path>

<taskdef resource="emma_ant.properties" classpathref="emma.lib.dir" />

<!-- End of emma configuration -->

2. <!-- - - - - - - - - - - - - - - - - -

target: emma-instrument

- - - - - - - - - - - - - - - - - -->

<target name="emma.instrument" if="enable.emma.on.test">

<property name="emma.enabled" value="true" />

<echo>Instrumenting classes from ${project.base.dir}/${android.project.dir}/bin,${project.base.dir}/${android.project.dir}/libs/sup-client.jar

</echo>

<!-- It only instruments class files, not any external libs -->

<emma enabled="${emma.enabled}">

<instr mode="overwrite"

instrpath="${project.base.dir}/${android.project.dir}/bin,${project.base.dir}/${android.project.dir}/libs/sup-client.jar"

outdir="${project.base.dir}/${android.project.dir}/bin">

</instr>

<!-- TODO: exclusion filters on R*.class and allowing custom exclusion from

user defined file -->

</emma>

<echo>Copy emma. to project libs</echo>

<copy todir="${project.base.dir}/${android.project.dir}/libs" overwrite="true">

<fileset dir="${emma.dir}" includes="emma_device.jar"/>

</copy>

</target>

333
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: