Open maciekf opened 5 years ago
This is the Gradle annotation processors approach. They would have you add the immutables annotations to your classpath (it can/should be compileOnly)
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)
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?
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.