bump annotation processors to java 17
This commit is contained in:
parent
58c5bd0f1b
commit
97f54b6673
|
@ -1,14 +1,15 @@
|
|||
apply plugin: "java-library"
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
dependencies {
|
||||
|
||||
implementation project(':annotation')
|
||||
|
||||
annotationProcessor 'com.google.auto.service:auto-service:1.0.1'
|
||||
compileOnly 'com.google.auto.service:auto-service:1.0.1'
|
||||
api 'com.google.auto.service:auto-service-annotations:1.0.1'
|
||||
implementation 'com.google.guava:guava:31.1-jre'
|
||||
|
||||
}
|
|
@ -23,7 +23,7 @@ import javax.lang.model.element.TypeElement;
|
|||
import javax.tools.JavaFileObject;
|
||||
|
||||
@AutoService(Processor.class)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_11)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_17)
|
||||
@SupportedAnnotationTypes("im.conversations.android.annotation.XmlElement")
|
||||
public class XmlElementProcessor extends AbstractProcessor {
|
||||
|
||||
|
@ -31,10 +31,9 @@ public class XmlElementProcessor extends AbstractProcessor {
|
|||
public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) {
|
||||
final Set<? extends Element> elements =
|
||||
roundEnvironment.getElementsAnnotatedWith(XmlElement.class);
|
||||
final ImmutableMap.Builder<Id, String> builder = ImmutableMap.<Id, String>builder();
|
||||
final ImmutableMap.Builder<Id, String> builder = ImmutableMap.builder();
|
||||
for (final Element element : elements) {
|
||||
if (element instanceof TypeElement) {
|
||||
final TypeElement typeElement = (TypeElement) element;
|
||||
if (element instanceof final TypeElement typeElement) {
|
||||
final Id id = of(typeElement);
|
||||
builder.put(id, typeElement.getQualifiedName().toString());
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
apply plugin: "java-library"
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
Loading…
Reference in a new issue