I'm trying to solve it but, unfortunately, I still have not managed to do it.
What I had progressed so far is the following (in Gradle): using the Ant task as a function and generate the sources into some build folder in which the dagger processor may find afterwards. But I admit this way might be totally awkward.
The following code snippet tries to use the ant task currently in lombok.jar in a project-agnostic approach.
final def generateJava = { ->
ant.taskdef(
name: 'delombok',
classname: 'lombok.delombok.ant.Tasks$Delombok',
classpath: configurations.annotationProcessor
.filter { (it.name =~ 'lombok') }.asPath
)
ant.mkdir(dir: sourceSets.main.output.classesDirs.asPath)
ant.delombok(
verbose: true,
encoding: StandardCharsets.UTF_8,
from: sourceSets.main.java.sourceDirectories.asPath,
to: sourceSets.main.output.classesDirs.asPath,
modulepath: sourceSets.main.runtimeClasspath.asPath
)
}
and, finally try to append the generated code in somewhere else Dagger can scan for.
sourceSets.main.java.srcDirs = sourceSets.main.output.classesDirs
I'm currently using Gradle version 6.0.1 and lombok 1.18.10. I'm not sure if it is backwards-compatible.