From 97f54b6673c186e013f8558f870bf1d3a0da70b3 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 10 Mar 2023 20:03:32 +0100 Subject: [PATCH] bump annotation processors to java 17 --- annotation-processor/build.gradle | 7 ++++--- .../android/annotation/processor/XmlElementProcessor.java | 7 +++---- annotation/build.gradle | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/annotation-processor/build.gradle b/annotation-processor/build.gradle index 4518d0e5b..0de5b825f 100644 --- a/annotation-processor/build.gradle +++ b/annotation-processor/build.gradle @@ -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' } \ No newline at end of file diff --git a/annotation-processor/src/main/java/im/conversations/android/annotation/processor/XmlElementProcessor.java b/annotation-processor/src/main/java/im/conversations/android/annotation/processor/XmlElementProcessor.java index 896cd6c84..38dce1586 100644 --- a/annotation-processor/src/main/java/im/conversations/android/annotation/processor/XmlElementProcessor.java +++ b/annotation-processor/src/main/java/im/conversations/android/annotation/processor/XmlElementProcessor.java @@ -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 set, RoundEnvironment roundEnvironment) { final Set elements = roundEnvironment.getElementsAnnotatedWith(XmlElement.class); - final ImmutableMap.Builder builder = ImmutableMap.builder(); + final ImmutableMap.Builder 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()); } diff --git a/annotation/build.gradle b/annotation/build.gradle index d5917e460..13a27e90c 100644 --- a/annotation/build.gradle +++ b/annotation/build.gradle @@ -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 } \ No newline at end of file