franzbecker / gradle-lombok

Gradle plugin for Lombok support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use new "compileOnly" dependency type

BrainStone opened this issue · comments

Gradle now has a compileOnly type by default. It would be better to use that because the lombok is not in the runtime.

Sorry for the late reply. With the current approach the Lombok dependency should not be in the runtime, right? In order to use the compileOnly configuration I would need to implement a check for the Gradle version (in order to be compatible with older versions) but I don't really see the advantage of that.

@franzbecker I apologize for the late reply as well.

The main use where this is handy is when using a project as an dependecy. Like for example I shade a subproject into my main project. At the current state I have to exclude lombok manually so it won't be shaded in the main jar. And it could be easily avoided by making it compileOnly because the gradle doesn't use it as a transitive dependecy.

And I came across similar cases, where lombok was a transitive dependency and that messed stuff up.

Unless you find another way of making it a non-transitive dependency.

Okay thanks for the update. I agree, it should not be a transitive dependency - that was an easy fix.
I'll release the version 1.9 with this fix in it - hope that helps!

Concerning the "compileOnly" configuration: I'll probably include that into the next release but right now I don't have the time. Will probably drop Gradle 2.x support as well.