Machine Scents


References

Animal Scents

There is a nice maven plugin and artifacts for checking application code against specific platform APIs.
Say, you want to make sure that your application code uses only those defined in Java 6? The Animal Sniffer Maven Plugin is just right plugin for that. Please check links above.

Machine Scents

I wrote some artifacts which each is a signature of Android APIs. Here comes how we can use it.

<dependencies>
  <dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android</artifactId>
    <version>${android.version}</version>
    <scope>provided</scope>
  </dependency>
</dependencies>

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  <android.version>2.3.3</android.version>
  <android.api.level>10</android.api.level>
</properties>

<build>

  <plugins>
    <plugin>
      <groupId>com.jayway.maven.plugins.android.generation2</groupId>
      <artifactId>android-maven-plugin</artifactId>
      <configuration>
        <sdk>
          <platform>${android.api.level}</platform>
        </sdk>
        <apk>
          <metaIncludes>
            <metaInclude>services/**</metaInclude>
          </metaIncludes>
        </apk>
      </configuration>
    </plugin>

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>animal-sniffer-maven-plugin</artifactId>
      <executions>
        <execution>
          <id>check-against-android-api-signature</id>
          <goals>
            <goal>check</goal>
          </goals>
          <configuration>
            <includeJavaHome>false</includeJavaHome>
            <signature>
              <groupId>com.googlecode.jinahya</groupId>
              <artifactId>android-api-signature-${android.api.level}</artifactId>
              <version>1.0.2</version>
            </signature>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>

</build>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s