Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Processors 2.0.0 do not work well with immutables #92

Open
maciekf opened this issue Nov 7, 2018 · 3 comments
Open

Processors 2.0.0 do not work well with immutables #92

maciekf opened this issue Nov 7, 2018 · 3 comments

Comments

@maciekf
Copy link

maciekf commented Nov 7, 2018

To upgrade gradle-processors to 2.0.0 I had to add a compile dependency on immutables, otherwise the compilation would fail with warning:

warning: unknown enum constant ImplementationVisibility.PACKAGE reason: class file for org.immutables.value.Value$Style$ImplementationVisibility not found error: warnings found and -Werror specified

Another issue is that after upgrading to 2.0.0 immutable classes which depend on conjure generated classes do not rebuild properly when conjure changes.

@j-baker
Copy link
Contributor

j-baker commented Nov 7, 2018

This is the Gradle annotation processors approach. They would have you add the immutables annotations to your classpath (it can/should be compileOnly)

@dansanduleac
Copy link
Contributor

Here's where they introduced this feature: https://docs.gradle.org/4.6/release-notes.html#convenient-declaration-of-annotation-processor-dependencies

They go into it a bit more in the blog post linked there, but the gist is that only annotations (e.g. Value.Immutable) need to be on the compile classpath (and even these can mostly be on compileOnly if they're just @Retention(RetentionPolicy.SOURCE) annotations)

@alicederyn
Copy link
Contributor

alicederyn commented Nov 7, 2018

Immutables says its annotations are needed in jar files for incremental compilation, but I'm uncertain what issue they're specifically working around or if it's actually necessary. Perhaps file a bug on them to have it looked at again?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants