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