Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Conversation

@mtraynham
Copy link
Contributor

MapStruct 1.4.0.Final was released recently, so I was hoping to take advantage of the full benefits of Kapt annotation incremental compiling for faster builds, but it didn't seem to be working and always seemed to do a full build.

The Builder annotation processing via mapstruct-kotlin had this spurious line in the logs during the build,

[WARN] Issue detected with com.github.pozo.BuilderProcessor. Expected 1 originating source file when generating /project/build/generated/source/kapt/main/com/project/ItemBuilder.java, but detected 0: [].

I tracked down the error message to Jetbrains kapt, https://github.com/JetBrains/kotlin/blob/master/plugins/kapt3/kapt3-base/src/org/jetbrains/kotlin/kapt3/base/incremental/incrementalProcessors.kt#L126-L129. Interestingly, if you hit this, it seems to set that isFullRebuild = true, which is probably not ideal.

Adding the originatingElement data class to the TypeSpec.classBuilder seems to correct the issue.

@mtraynham
Copy link
Contributor Author

@Pozo would be great if this got merged, seems to reduce build times immensely!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant