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 gradle incremental annotation processing for tritium-processor #1085

Merged
merged 5 commits into from
May 13, 2021

Conversation

carterkozak
Copy link
Contributor

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

==COMMIT_MSG==
Enable gradle incremental annotation processing for tritium-processor
==COMMIT_MSG==

Possible downsides?

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.

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.
@changelog-app
Copy link

changelog-app bot commented May 13, 2021

Generate changelog in changelog/@unreleased

Type

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

Description

Enable gradle incremental annotation processing for tritium-processor

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from tetigi May 13, 2021 16:00
Copy link
Member

@pkoenig10 pkoenig10 left a comment

Choose a reason for hiding this comment

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

The generated file needs to have a single originating element for incremental compilation to work. See palantir/dialogue#1240.

It looks like we don't specify an originating element when building the TypeSpec.

Given that we're relying on the implementation of JavaPoet for this, might be a good idea to just add an assertion that the TypeSpec in the JavaFile has exactly 1 originating element.

@pkoenig10
Copy link
Member

pkoenig10 commented May 13, 2021

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.

Agreed, we should just change Dialogue.

palantir/dialogue#1255

@carterkozak
Copy link
Contributor Author

Good catch, updated with an originating element.

@bulldozer-bot bulldozer-bot bot merged commit 07df603 into develop May 13, 2021
@bulldozer-bot bulldozer-bot bot deleted the ckozak/gradle_incremental_builds branch May 13, 2021 17:57
@svc-autorelease
Copy link
Collaborator

Released 0.18.11

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.

3 participants