Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Formalizes compliance with Android 8, SDK 26 (2017+) #613

Merged
merged 3 commits into from
Sep 26, 2022

Conversation

vitorpamplona
Copy link
Contributor

@vitorpamplona vitorpamplona commented Sep 25, 2022

This PR formalizes this project's compliance with Android

  1. Adds an Animal Sniffer plugin to check compliance with any runtime API when running mvn test
  2. Selects modules engine, engine.fhir and engine.jackson to be checked for Android compliance.
  3. Establishes initial compliance to Android 8 - SDK 26, the minimum Android version the Translator is currently fully compliant with.

Important: The plugin only verifies the source code in this project, not dependencies.

For testing, add:

if (Optional.of(UUID.randomUUID()).isEmpty())
   throw new RuntimeException("Test");

in the desired module and run mvn animal-sniffer:check.

Since the method Optional.isEmpty is not available on Android, the output should look like this:

Screen Shot 2022-09-25 at 6 28 31 PM

@JPercival
Copy link
Contributor

Is there a version of this plugin that hooks into the compiler so that devs get immediate feedback prior to a build? Something like ErrorProne?

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>8</source>
          <target>8</target>
          <encoding>UTF-8</encoding>
          <compilerArgs>
            <arg>-XDcompilePolicy=simple</arg>
            <arg>-Xplugin:ErrorProne</arg>
          </compilerArgs>
          <annotationProcessorPaths>
            <path>
              <groupId>com.google.errorprone</groupId>
              <artifactId>error_prone_core</artifactId>
              <version>${error-prone.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants