tree: e4c874388e8b1353afb772769b71d4185ff66e02 [path history] [tgz]
  1. src/
  2. Android.bp
  3. pom.xml

Auto Common Utilities


The Auto project has a set of common utilities to help ease use of the annotation processing environment.

Utility classes of note

  • MoreTypes - utilities and Equivalence wrappers for TypeMirror and related subtypes
  • MoreElements - utilities for Element and related subtypes
  • SuperficialValidation - very simple scanner to ensure an Element is valid and free from distortion from upstream compilation errors
  • Visibility - utilities for working with Elements' visibility levels (public, protected, etc.)
  • BasicAnnotationProcessor/ProcessingStep - simple types that
    • implement a validating annotation processor
    • defer invalid elements until later
    • break processor actions into multiple steps (which may each handle different annotations)


Auto common utilities have a standard Maven setup which can also be used from Gradle, Ivy, Ant, or other systems which consume binary artifacts from the central Maven binary artifact repositories.

  <version>1.0-SNAPSHOT</version> <!-- or use a known release version -->

Processor Resilience

Auto Common Utilities is used by a variety of annotation processors in Google and new versions may have breaking changes. Users of auto-common are urged to use shade or jarjar (or something similar) in packaging their processors so that conflicting versions of this library do not adversely interact with each other.

For example, in a Maven build you can repackage into like this:

  <!-- your other config -->
                  <!-- exclude dependencies you don't want to bundle in your processor -->