Skip to content

Commit

Permalink
Enable Lombok by default on Java 11+ (#4989)
Browse files Browse the repository at this point in the history
* Enable Lombok by default

Using local edge release jar

* Remove feature flag from LombokTest

* Restore Lombok feature flag for Java 8 for now

* Add toml to IDE.properties.tmp

* Restore feature flags in LombokTest for Java 8
  • Loading branch information
timtebeek authored Feb 5, 2025
1 parent 5541466 commit 422c053
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions IDE.properties.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ rewrite-json
rewrite-maven
rewrite-properties
rewrite-protobuf
rewrite-toml
rewrite-xml
rewrite-yaml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.io.Serializable;

/**
* Every model object that is transferred via the tooling API must implement {@link Serializable}, including
* Every model object that is transferred via the tooling API must implement {@link java.io.Serializable}, including
* certain maven model objects that are shared by rewrite-gradle.
*/
class OpenRewriteModelSerializableTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ private ReloadableJava11Parser(
Options.instance(context).put("should-stop.ifError", "GENERATE");

LOMBOK:
if (System.getenv().getOrDefault("REWRITE_LOMBOK", System.getProperty("rewrite.lombok")) != null &&
classpath != null && classpath.stream().anyMatch(it -> it.toString().contains("lombok"))) {
if (classpath != null && classpath.stream().anyMatch(it -> it.toString().contains("lombok"))) {
Processor lombokProcessor = null;
try {
// https://projectlombok.org/contributing/lombok-execution-path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ private ReloadableJava17Parser(
Options.instance(context).put("should-stop.ifError", "GENERATE");

LOMBOK:
if (System.getenv().getOrDefault("REWRITE_LOMBOK", System.getProperty("rewrite.lombok")) != null &&
classpath != null && classpath.stream().anyMatch(it -> it.toString().contains("lombok"))) {
if (classpath != null && classpath.stream().anyMatch(it -> it.toString().contains("lombok"))) {
Processor lombokProcessor = null;
try {
// https://projectlombok.org/contributing/lombok-execution-path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ private ReloadableJava21Parser(
Options.instance(context).put("should-stop.ifError", "GENERATE");

LOMBOK:
if (System.getenv().getOrDefault("REWRITE_LOMBOK", System.getProperty("rewrite.lombok")) != null &&
classpath != null && classpath.stream().anyMatch(it -> it.toString().contains("lombok"))) {
if (classpath != null && classpath.stream().anyMatch(it -> it.toString().contains("lombok"))) {
Processor lombokProcessor = null;
try {
// https://projectlombok.org/contributing/lombok-execution-path
Expand Down
3 changes: 2 additions & 1 deletion rewrite-java-lombok/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ dependencies {
runtimeOnly("org.projectlombok:lombok:latest.release")

// Add lombok dependency to the newly created lombok configuration
lombok("org.projectlombok:lombok:latest.release")
//lombok("org.projectlombok:lombok:latest.release")
lombok(files("libs/lombok-1.18.37.jar")) // Temporary pending the next stable release of lombok
compileOnly(files(tools))
compileOnly(files(unpackedAndRenamedLombokDir))
}
Expand Down
Binary file added rewrite-java-lombok/libs/lombok-1.18.37.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class LombokTest implements RewriteTest {

@BeforeAll
static void setUp() {
// Only needed for Java 8, until enabled by default there
System.setProperty("rewrite.lombok", "true");
}

Expand Down

0 comments on commit 422c053

Please sign in to comment.