Maven-Plugin for checking API-Compliance with Android
I'm looking for a Maven-Plugin that can check Jar/Class-Files for compliance with a specified API Level of Android. E.g. can all Classes and Methods be resolved in the Android API.. Does someone know about such a plugin? The DX tool doesn't seem to provide such functionality or am I missing something?
Use case: I wrote some Jar-Files which should be used in Desktop-Java-Applications as well in Android-Apps. Now I want to make sure that these Jar-Files are compliant to the Android API of a certain level.
My current workaround would be to run my Unit-Tests in an Android-Emulator.
Since there was no such tool available I wrote it myself. http://code.google.com/p/compliancechecker/
It's a plugin for the maven build system which supports validating Java SE 1.4, 1.5, 1.6 and 1.7 code against a certain android api level.
This will looks like :
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>animal-sniffer-maven-plugin</artifactId> <version>1.16</version> <configuration> <signature> <groupId>net.sf.androidscents.signature</groupId> <artifactId>android-api-level-19</artifactId> <version>4.4_r1</version> </signature> </configuration> </plugin>
See animal-sniffer-maven-plugin for more details.
More resources about android level API :