gradle-plugins icon indicating copy to clipboard operation
gradle-plugins copied to clipboard

[Feature Request] Lombok Plugin: Update `withSourcesJar()` to use the delomboked source

Open pluttrell opened this issue 4 years ago • 3 comments

Gradle's JavaPluginExtension includes a withSourcesJar() that automatically packages source code (reference docs).

This is a feature request for the Lombok plugin to change the source to the delomboked source.

pluttrell avatar Apr 22 '21 01:04 pluttrell

The sourcesJar task currently does not use the delombok-ed sources on purpose.

With the current setup the line-numbers of the source code inside the -sources jar and the LineNumberTable inside the .class-files inside the normal jar match each other.

larsgrefer avatar Apr 23 '21 20:04 larsgrefer

How can we use the delombok-ed sources with the sourcesJar ? An easy option inside the plugin would be nice

ErwanLeroux avatar Jul 01 '21 14:07 ErwanLeroux

This should do the trick:

sourcesJar {
    exclude {
        sourceSets.main.allSource.contains it.file
    }
    from delombok
}

larsgrefer avatar Jul 26 '21 13:07 larsgrefer