I know how to use emma in ant when building my android test project but I can't find any tips on how to use filters when using the SDK. The emma website explains it when calling emma yourself but in the Android SDK build files emma is not called in the ant files or on the commandline so I'm not able to add the filter options.
Anyone any suggestions?
It depends on the SDK version you are using, specifically the included build files found in
<android-sdk>/tools/ant
directory.Android SDK >= 18
As of the SDK r18 and above it's as simple as adding a property to your
ant.properties
file of the target (not test) project. So for example useTo exlude all classes from a test package. You can find the emma filter syntax in the emma documentation.
Android SDK < 18
There's an issue for this. It involves the following:
-emma-instrument
target from the imported android build files (you should find an explanation of this method in the standard project build file which you get by runningandroid create/update project
)modify the target according to the linked issue, it'll look like:
an explanation of the exclusion filter syntax is available on the emma documentation
emma.exclusion.pattern
to provide your own exclusionsFor me this has worked like a charm on SDK tools r13.
As of SDK Tools r18 you can simply add
to the ant.properties of your project (not Test project)