projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.9k stars 2.39k forks source link

Update Gradle install documentation for 4.7+ according to new annotationProcessor configuration #1734

Open coderatchet opened 6 years ago

coderatchet commented 6 years ago

The gradle installation documentation does not include the new gradle 4.7+ annotation processor configuration instructions:

The following is recommended when configuring a gradle project:

ext['lombok.version'] = 1.16.22

dependencies {
  annotationProcessor 'org.projectlombok:lombok:${lombok.version}'
  implementation 'org.projectlombok:lombok:${lombok.version}'

  // if using lombok in test classes
  testAnnotationProcessor 'org.projectlombok:lombok:${lombok.version}'
  testImplementation 'org.projectlombok:lombok:${lombok.version}'

  // if using lombok in any other source set configuration
  // <sourceset>AnnotationProcessor 'org.projectlombok:lombok:${lombok.version}'
  // <sourceset>Implementation 'org.projectlombok:lombok:${lombok.version}'
}

Here is the Gradle documentation on including annotationProcessors on the compile classpath

Here is the stackoverflow question showing the problem I encountered when configuring lombok.

larsgrefer commented 6 years ago

I've created a simple Gradle plugin which does this: https://plugins.gradle.org/plugin/io.freefair.lombok

apply plugin: "io.freefair.lombok"
lombok.version = "1.18.0"
soberich commented 6 years ago

@coderatchet cool, you're right. That's a big one. I thought you messed up with implementation <=> compileOnly