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

Gradle: ObjectMapperProcessor is not incremental, full recompilation is required #30

Open
natros opened this issue Feb 21, 2020 · 2 comments

Comments

@natros
Copy link

natros commented Feb 21, 2020

Is it possible to make the annotation processor incremental?

https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing

Right now gradle complains that org.dominokit.jacksonapt.processor.ObjectMapperProcessor is not incremental and a full recompilation is required.

 Task :compileJava
Build cache key for task ':compileJava' is 8832ef9fce86b8122d4f38033a68122b
Task ':compileJava' is not up-to-date because:
  Input property 'stableSources' file /Users/fsousa/Projects/demo/gwt-jackson-demo/src/main/java/pt/ipb/demos/gwt/jackson/client/Main.java has changed.
Created classpath snapshot for incremental compilation in 0.001 secs.
Class dependency analysis for incremental compilation took 0.001 secs.
Full recompilation is required because org.dominokit.jacksonapt.processor.ObjectMapperProcessor is not incremental. Analysis took 0.002 secs.
 Task :compileJava
Build cache key for task ':compileJava' is 8832ef9fce86b8122d4f38033a68122b
Task ':compileJava' is not up-to-date because:
  Input property 'stableSources' file /Users/fsousa/Projects/demo/gwt-jackson-demo/src/main/java/pt/ipb/demos/gwt/jackson/client/Main.java has changed.
Created classpath snapshot for incremental compilation in 0.001 secs.
Class dependency analysis for incremental compilation took 0.001 secs.
Full recompilation is required because org.dominokit.jacksonapt.processor.ObjectMapperProcessor is not incremental. Analysis took 0.002 secs.

Thanks.

@niloc132
Copy link

I believe, but am not certain, that this process cannot qualify for any incremental mode. It might be possible to be marked as aggregating, but even that could depend on whether or not json beans are actually present as sources (and can be used as originating elements in aggregating) or are elsewhere on the classpath (separate modules, which then need to re-trigger building this module and fully running the processor).

That said, if mapstruct (see mapstruct/mapstruct#1420, mapstruct/mapstruct#1971, mapstruct/mapstruct#1414) is able to support this without caveats, it may be possible.

From the link, I don't see what a processor should do to explicitly opt-out - for example if it uses a compiler task/plugin, how would it say "no, I actually need to re-run if my files change in any way, not just their API"?

@natros
Copy link
Author

natros commented Feb 21, 2020

I don't know the internals of domino-jackson, but google dagger is fully incremental.

There is already an incremental gwt module that supports isolation:
https://github.com/gwtproject/gwt-places/blob/master/processor/src/main/java/org/gwtproject/place/processor/PlaceHistoryMapperProcessor.java#L15

When the GWT migration is completed, I suppose there will be many modules that uses the annotation processor and that can make the compile task time consuming.

I think gradle is smart enough to know what needs to be compiled.

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

No branches or pull requests

2 participants