You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: common/README.md
+57-3Lines changed: 57 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,26 @@ Auto Common Utilities
3
3
4
4
## Overview
5
5
6
-
The Auto project has a set of common utilities to help ease use of the annotation processing environment.
6
+
The Auto project has a set of common utilities to help ease use of the annotation processing
7
+
environment.
7
8
8
9
## Utility classes of note
9
10
10
11
* MoreTypes - utilities and Equivalence wrappers for TypeMirror and related subtypes
11
12
* MoreElements - utilities for Element and related subtypes
12
-
* SuperficialValidation - very simple scanner to ensure an Element is valid and free from distortion from upstream compilation errors
13
+
* SuperficialValidation - very simple scanner to ensure an Element is valid and free from
14
+
distortion from upstream compilation errors
13
15
* Visibility - utilities for working with Elements' visibility levels (public, protected, etc.)
16
+
* BasicAnnotationProcessor/ProcessingStep - simple types that
17
+
- implement a validating annotation processor
18
+
- defer invalid elements until later
19
+
- break processor actions into multiple steps (which may each handle different annotations)
14
20
15
21
## Usage/Setup
16
22
17
-
Auto common utilities have a standard maven setup which can be used from Gradle, Ivy, Ant, or other systems which consume binary artifacts from the central maven repositories.
23
+
Auto common utilities have a standard [Maven](http://maven.apache.org) setup which can also be
24
+
used from Gradle, Ivy, Ant, or other systems which consume binary artifacts from the central Maven
25
+
binary artifact repositories.
18
26
19
27
```xml
20
28
<dependency>
@@ -23,3 +31,49 @@ Auto common utilities have a standard maven setup which can be used from Gradle,
23
31
<version>1.0-SNAPSHOT</version> <!-- or use a known release version -->
24
32
</dependency>
25
33
```
34
+
35
+
## Processor Resilience
36
+
37
+
Auto Common Utilities is used by a variety of annotation processors in Google and new versions
38
+
may have breaking changes. Users of auto-common are urged to use
39
+
[shade](https://maven.apache.org/plugins/maven-shade-plugin/) or
40
+
[jarjar](https://code.google.com/p/jarjar/) (or something similar) in packaging their processors
41
+
so that conflicting versions of this library do not adversely interact with each other.
42
+
43
+
For example, in a Maven build you can repackage `com.google.auto.common` into
44
+
`your.processor.shaded.auto.common` like this:
45
+
46
+
```xml
47
+
<project>
48
+
<!-- your other config -->
49
+
<build>
50
+
<plugins>
51
+
<plugin>
52
+
<artifactId>maven-shade-plugin</artifactId>
53
+
<executions>
54
+
<execution>
55
+
<phase>package</phase>
56
+
<goals>
57
+
<goal>shade</goal>
58
+
</goals>
59
+
<configuration>
60
+
<artifactSet>
61
+
<excludes>
62
+
<!-- exclude dependencies you don't want to bundle in your processor -->
0 commit comments