Conversation
| import io.franzbecker.gradle.lombok.task.DelombokTask | ||
|
|
||
| task delombok(type: DelombokTask, dependsOn: compileJava) { | ||
| ext.outputDir = file("$buildDir/delombok/main") | ||
| outputs.dir(outputDir) | ||
| sourceSets.main.java.srcDirs.each { | ||
| inputs.dir(it) | ||
| args(it, "-d", outputDir) | ||
| } | ||
| doFirst { | ||
| outputDir.deleteDir() | ||
| } | ||
| } | ||
|
|
||
| task delombokTest(type: DelombokTask, dependsOn: compileJava) { | ||
| ext.outputDir = file("$buildDir/delombok/test") | ||
| outputs.dir(outputDir) | ||
| sourceSets.test.java.srcDirs.each { | ||
| inputs.dir(it) | ||
| args(it, "-d", outputDir) | ||
| } | ||
| doFirst { | ||
| outputDir.deleteDir() | ||
| } | ||
| } |
There was a problem hiding this comment.
This is no longer necessary: the new plugins automatically creates these tasks for us.
| task delombokHelp(type: DelombokTask) { | ||
| args "--help" | ||
| } |
There was a problem hiding this comment.
This task was never particularly useful.
| dependsOn delombok | ||
| source = delombok.outputDir |
There was a problem hiding this comment.
Also no longer necessary, the plugin automatically does this.
| javadoc { | ||
| dependsOn delombok | ||
| source = delombok.outputDir | ||
| failOnError = true |
There was a problem hiding this comment.
This is the default value so I removed it.
| failOnError = true | ||
| task sourcesJar(type: Jar) { | ||
| classifier = "sources" | ||
| from delombok |
There was a problem hiding this comment.
This ensure the sources JAR uses the delombok'd sources.
| } | ||
|
|
||
| task makeJavadocsJar(type: Jar, dependsOn: makeJavadocs) { | ||
| task javadocJar(type: Jar, dependsOn: javadoc) { |
There was a problem hiding this comment.
Since the default javadoc task is updated by the plugin to use the delombok'd sources, we simply need to reference it and no longer need the makeJavadocs task.
richardm-stripe
left a comment
There was a problem hiding this comment.
Looks good! I think some of your PR comments might be useful as inline code comments, too.
r? @richardm-stripe
Upgrade Lombok Gradle plugin, and bump Lombok to the latest version.
The official Gradle plugin for Lombok changed, so this was a bit of a tricky update, but it does simplify the Gradle configuration and I've verified that the generated sources and Javadoc artifacts are unchanged (save for some minor changes brought by the Lombok upgrade itself and unrelated to the plugin).