checking android signature with maven


I just found that android doesn’t like following line.

final Random random = ThreadLocalRandom.current(); // cool, isn't it?

Because there is no such class named java.util.concurrent.ThreadLocalRandom in Android runtime (at least 2.3.3).

Machine Scents

I made an artifact for maven users.

<project ...>
  <groupId>...</groupId>
  <artifactId>...</artifactId>
  <version>...</version>
  <packaging>apk</packaging>
  <dependencies>
    <dependency>
      <groupId>com.google.android</groupId>
      <artifactId>android</artifactId>
       <version>2.3.3</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
        <artifactId>android-maven-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <sdk>
            <platform>10</platform>
          </sdk>
          <apk>
            <metaIncludes>
              <metaInclude>services/**</metaInclude>
            </metaIncludes>
          </apk>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.9</version>
        <executions>
          <execution>
            <id>check</id>
            <!--phase>process-classes</phase-->
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <includeJavaHome>false</includeJavaHome>
              <signature>
                <groupId>com.googlecode.jinahya</groupId>
                <artifactId>android-api-signature-10</artifactId>
                <version>1.0</version>
              </signature>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
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