diff --git a/changelog/@unreleased/pr-1231.v2.yml b/changelog/@unreleased/pr-1231.v2.yml new file mode 100644 index 000000000..b5deeccc0 --- /dev/null +++ b/changelog/@unreleased/pr-1231.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: The Dialogue annotation processor now supports incremental compilation. + links: + - https://github.com/palantir/dialogue/pull/1231 diff --git a/dialogue-annotations-processor/build.gradle b/dialogue-annotations-processor/build.gradle index e15493367..ef092e11a 100644 --- a/dialogue-annotations-processor/build.gradle +++ b/dialogue-annotations-processor/build.gradle @@ -30,6 +30,8 @@ dependencies { annotationProcessor 'com.google.auto.service:auto-service' compileOnly 'com.google.auto.service:auto-service' + annotationProcessor 'net.ltgt.gradle.incap:incap-processor' + compileOnly 'net.ltgt.gradle.incap:incap' annotationProcessor 'org.immutables:value' compileOnly 'org.immutables:value::annotations' annotationProcessor 'org.derive4j:derive4j' @@ -37,6 +39,7 @@ dependencies { testAnnotationProcessor 'org.immutables:value' testCompileOnly 'org.immutables:value::annotations' + testCompileOnly 'net.ltgt.gradle.incap:incap' testImplementation project(':dialogue-annotations') testImplementation project(':dialogue-target') testImplementation 'com.fasterxml.jackson.core:jackson-annotations' diff --git a/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/DialogueRequestAnnotationsProcessor.java b/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/DialogueRequestAnnotationsProcessor.java index 1deda6683..78d9740ee 100644 --- a/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/DialogueRequestAnnotationsProcessor.java +++ b/dialogue-annotations-processor/src/main/java/com/palantir/dialogue/annotations/processor/DialogueRequestAnnotationsProcessor.java @@ -60,9 +60,12 @@ import javax.lang.model.util.Elements; import javax.lang.model.util.Types; import javax.tools.Diagnostic.Kind; +import net.ltgt.gradle.incap.IncrementalAnnotationProcessor; +import net.ltgt.gradle.incap.IncrementalAnnotationProcessorType; @SupportedSourceVersion(SourceVersion.RELEASE_8) @AutoService(Processor.class) +@IncrementalAnnotationProcessor(IncrementalAnnotationProcessorType.ISOLATING) public final class DialogueRequestAnnotationsProcessor extends AbstractProcessor { private Messager messager; diff --git a/versions.lock b/versions.lock index 6c0444912..3cee81e2c 100644 --- a/versions.lock +++ b/versions.lock @@ -51,6 +51,7 @@ io.dropwizard.metrics:metrics-core:3.2.6 (3 constraints: b125441c) jakarta.annotation:jakarta.annotation-api:1.3.5 (3 constraints: ee256969) jakarta.ws.rs:jakarta.ws.rs-api:2.1.6 (3 constraints: ee256969) joda-time:joda-time:2.10.8 (1 constraints: 2e16acf1) +net.ltgt.gradle.incap:incap:0.3 (1 constraints: a7041a2c) org.apache.httpcomponents.client5:httpclient5:5.0.3 (1 constraints: 0a050736) org.apache.httpcomponents.core5:httpcore5:5.1 (3 constraints: 392a5176) org.apache.httpcomponents.core5:httpcore5-h2:5.0.2 (1 constraints: 3b13053c) diff --git a/versions.props b/versions.props index 66bc0bea8..1c1d5a5ad 100644 --- a/versions.props +++ b/versions.props @@ -17,6 +17,7 @@ com.palantir.tritium:* = 0.18.8 com.squareup:javapoet = 1.13.0 com.uber.nullaway:nullaway = 0.9.0 io.dropwizard.metrics:metrics-core = 3.2.6 +net.ltgt.gradle.incap:* = 0.3 org.apache.httpcomponents.client5:httpclient5 = 5.0.3 org.apache.httpcomponents.core5:httpcore5 = 5.1 org.derive4j:* = 1.1.1