Skip to content

Commit 632a8c5

Browse files
committed
Java 16 + gradle 7.0 compatibility
1 parent ed6a0e5 commit 632a8c5

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

build.gradle

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import java.time.OffsetDateTime
22
import java.time.format.DateTimeFormatter
3-
import io.franzbecker.gradle.lombok.task.DelombokTask
43

54
buildscript {
65
repositories {
@@ -29,7 +28,7 @@ buildscript {
2928
// https://github.com/spring-projects/spring-security-oauth/releases
3029
springSecurityOAuthVersion = '2.5.1.RELEASE'
3130

32-
lombokPluginVersion = '4.0.0'
31+
lombokPluginVersion = '5.3.3.3'
3332
versioningPluginVersion = '2.14.0'
3433
versionsPluginVersion = '0.29.0'
3534
}
@@ -42,9 +41,9 @@ plugins {
4241
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
4342
id 'net.nemerosa.versioning' version '2.14.0'
4443
id 'com.google.protobuf' version '0.8.15'
45-
id 'io.franzbecker.gradle-lombok' version '4.0.0' apply false
44+
id 'io.freefair.lombok' version '5.3.3.3' apply false
4645
id 'com.github.ben-manes.versions' version '0.36.0' // gradle dependencyUpdates
47-
id 'com.diffplug.spotless' version '5.11.0'
46+
id 'com.diffplug.spotless' version '5.12.1'
4847
}
4948

5049
// If you attempt to build without the `--scan` parameter in `gradle 6.0+` it will cause a build error that it can't find
@@ -77,7 +76,7 @@ allprojects {
7776
apply plugin: 'eclipse'
7877
apply plugin: 'io.spring.dependency-management'
7978
apply plugin: 'com.diffplug.spotless'
80-
apply plugin: 'io.franzbecker.gradle-lombok'
79+
apply plugin: 'io.freefair.lombok'
8180

8281
java {
8382
toolchain {
@@ -218,17 +217,6 @@ allprojects { project ->
218217
}
219218

220219
if (project.name == 'grpc-common-spring-boot' || project.name == 'grpc-client-spring-boot-autoconfigure' || project.name == 'grpc-server-spring-boot-autoconfigure') {
221-
// Properly generate javadocs for the important projects
222-
223-
task delombok(type: DelombokTask, dependsOn: compileJava) {
224-
ext.outputDir = file("$buildDir/delombok")
225-
outputs.dir(outputDir)
226-
sourceSets.main.java.srcDirs.each {
227-
inputs.dir(it)
228-
args(it, '-d', outputDir)
229-
}
230-
}
231-
232220
java {
233221
registerFeature('optionalSupport') {
234222
usingSourceSet(sourceSets.main)
@@ -241,7 +229,7 @@ allprojects { project ->
241229
if (project.name != 'grpc-common-spring-boot') {
242230
dependsOn(":grpc-common-spring-boot:javadoc")
243231
}
244-
source = delombok.outputDir
232+
source = delombok
245233
failOnError = false
246234
options.locale = 'en_US'
247235
options.encoding = 'UTF-8'

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ org.gradle.caching=true
55
org.gradle.vfs.watch=true
66
org.gradle.daemon=true
77

8+
# for spotless java 16 compatibility: https://github.com/diffplug/spotless/issues/834
9+
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
10+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
11+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
12+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
13+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

0 commit comments

Comments
 (0)