Skip to content

Commit 160aa65

Browse files
committed
build: add Lombok 1.18.46 (provided scope) + lombok.config
Cross-repo decision to use Lombok at the latest version for compile-time generation of equals/hashCode/toString without runtime reflection. See BAF commit 31eb6ef for the full decision record. `<scope>provided</scope>` keeps Lombok off the runtime classpath; `requires static lombok;` in module-info.java keeps it compile-time only. The new lombok.config pins the standard cross-repo settings (addLombokGeneratedAnnotation, callSuper = call, stopBubbling). This commit is dependency-only. Per-class @tostring / @EqualsAndHashCode adoption is deferred until after the BAF restoration loop concludes and the user reviews the BAF approach. https://claude.ai/code/session_01LzoKmqzgtQsELS5tsH4Wog
1 parent 337d266 commit 160aa65

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

lombok.config

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2026 Bernard Ladenthin <bernard.ladenthin@gmail.com>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Stop the config-resolution from bubbling up into parent directories.
6+
config.stopBubbling = true
7+
8+
# Emit @lombok.Generated on every generated member. SpotBugs / JaCoCo /
9+
# SonarQube special-case this annotation and skip the synthetic methods
10+
# from coverage requirements and bug detectors.
11+
lombok.addLombokGeneratedAnnotation = true
12+
13+
# Default to "call" on @EqualsAndHashCode / @ToString: when extending a
14+
# non-Object parent we want the parent's state included; failing loud
15+
# forces an explicit decision per class.
16+
lombok.equalsAndHashCode.callSuper = call
17+
lombok.toString.callSuper = call
18+
19+
# Do NOT generate Spring-style @ConstructorProperties; java.beans is not
20+
# needed by this codebase and pulls in the desktop module on some JDKs.
21+
lombok.anyConstructor.addConstructorProperties = false
22+
23+
lombok.accessors.flagUsage = ALLOW

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ SPDX-License-Identifier: MIT
5151
<properties>
5252
<jna.version>5.18.1</jna.version>
5353
<jspecify.version>1.0.0</jspecify.version>
54+
<lombok.version>1.18.46</lombok.version>
5455
<errorprone.version>2.49.0</errorprone.version>
5556
<nullaway.version>0.13.4</nullaway.version>
5657
<checker.version>4.2.0</checker.version>
@@ -100,6 +101,12 @@ SPDX-License-Identifier: MIT
100101
</dependencyManagement>
101102

102103
<dependencies>
104+
<dependency>
105+
<groupId>org.projectlombok</groupId>
106+
<artifactId>lombok</artifactId>
107+
<version>${lombok.version}</version>
108+
<scope>provided</scope>
109+
</dependency>
103110
<dependency>
104111
<groupId>org.junit.jupiter</groupId>
105112
<artifactId>junit-jupiter</artifactId>

src/main/java/module-info.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
module net.ladenthin.llama {
4242
requires static org.jspecify;
4343

44+
// Lombok is `provided` scope: only used at compile time to generate equals/hashCode/toString.
45+
// `requires static` means the runtime does not need the lombok jar on the module path —
46+
// the @lombok.Generated annotation carried on generated members has CLASS retention.
47+
requires static lombok;
48+
4449
exports net.ladenthin.llama;
4550
exports net.ladenthin.llama.args;
4651
exports net.ladenthin.llama.json;

0 commit comments

Comments
 (0)