Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable incremental annotation processing #1231

Merged
merged 3 commits into from
May 3, 2021

Conversation

pkoenig10
Copy link
Member

Before this PR

The Dialogue annotation processor does not support incremental compilation.

After this PR

The Dialogue annotation processor does support incremental compilation.

@changelog-app
Copy link

changelog-app bot commented May 3, 2021

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

The Dialogue annotation processor now supports incremental compilation.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from robert3005 May 3, 2021 17:36
annotationProcessor 'org.immutables:value'
compileOnly 'org.immutables:value::annotations'
annotationProcessor 'org.derive4j:derive4j'
compileOnly 'org.derive4j:derive4j-annotation'

testAnnotationProcessor 'org.immutables:value'
testCompileOnly 'org.immutables:value::annotations'
testCompileOnly 'net.ltgt.gradle.incap:incap'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary because the IncrementalAnnotationProcessor annotation has class retention. This is acceptable because downstream consumers do not compile against the annotation processor, see https://github.com/tbroyer/gradle-incap-helper#usage.

@bulldozer-bot bulldozer-bot bot merged commit 327a42c into develop May 3, 2021
@bulldozer-bot bulldozer-bot bot deleted the pkoenig10/incremental branch May 3, 2021 17:42
@svc-autorelease
Copy link
Collaborator

Released 1.124.0

@jkozlowski
Copy link
Contributor

jkozlowski commented May 4, 2021

Thanks! How does this actually work, and where was this causing issues?

carterkozak added a commit to palantir/tritium that referenced this pull request May 13, 2021
Based loosely on palantir/dialogue#1231

I opted against using annotation processors for simplicity. I
had minor issues with intellij, and generally find META-INF files
easier to reason about that annotation processors which write
one-line files.

Documentation for incremental processing can be found here:
https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing

It's possible that this feature may cause issues if we attempt to
instrument types that are genereated from other annotation processors,
however that is somewhat unlikely, and the docs describe that
as a valid case for `isolating` configuration.
carterkozak added a commit to palantir/tritium that referenced this pull request May 13, 2021
Based on palantir/dialogue#1231

I opted against using annotation processors for simplicity. I
had minor issues with intellij, and generally find META-INF files
easier to reason about that annotation processors which write
one-line files.

Documentation for incremental processing can be found here:
https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing

It's possible that this feature may cause issues if we attempt to
instrument types that are genereated from other annotation processors,
however that is somewhat unlikely, and the docs describe that
as a valid case for `isolating` configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants