From 632a8c5b460e1b8bfdcc3dfb6239a0c68b1f40c7 Mon Sep 17 00:00:00 2001 From: Andrey Popfalushi Date: Fri, 16 Apr 2021 11:13:30 +0300 Subject: [PATCH 1/3] Java 16 + gradle 7.0 compatibility --- build.gradle | 22 +++++----------------- gradle.properties | 6 ++++++ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index d14bd3677..959adb716 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,5 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter -import io.franzbecker.gradle.lombok.task.DelombokTask buildscript { repositories { @@ -29,7 +28,7 @@ buildscript { // https://github.com/spring-projects/spring-security-oauth/releases springSecurityOAuthVersion = '2.5.1.RELEASE' - lombokPluginVersion = '4.0.0' + lombokPluginVersion = '5.3.3.3' versioningPluginVersion = '2.14.0' versionsPluginVersion = '0.29.0' } @@ -42,9 +41,9 @@ plugins { id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'net.nemerosa.versioning' version '2.14.0' id 'com.google.protobuf' version '0.8.15' - id 'io.franzbecker.gradle-lombok' version '4.0.0' apply false + id 'io.freefair.lombok' version '5.3.3.3' apply false id 'com.github.ben-manes.versions' version '0.36.0' // gradle dependencyUpdates - id 'com.diffplug.spotless' version '5.11.0' + id 'com.diffplug.spotless' version '5.12.1' } // 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 { apply plugin: 'eclipse' apply plugin: 'io.spring.dependency-management' apply plugin: 'com.diffplug.spotless' - apply plugin: 'io.franzbecker.gradle-lombok' + apply plugin: 'io.freefair.lombok' java { toolchain { @@ -218,17 +217,6 @@ allprojects { project -> } if (project.name == 'grpc-common-spring-boot' || project.name == 'grpc-client-spring-boot-autoconfigure' || project.name == 'grpc-server-spring-boot-autoconfigure') { - // Properly generate javadocs for the important projects - - task delombok(type: DelombokTask, dependsOn: compileJava) { - ext.outputDir = file("$buildDir/delombok") - outputs.dir(outputDir) - sourceSets.main.java.srcDirs.each { - inputs.dir(it) - args(it, '-d', outputDir) - } - } - java { registerFeature('optionalSupport') { usingSourceSet(sourceSets.main) @@ -241,7 +229,7 @@ allprojects { project -> if (project.name != 'grpc-common-spring-boot') { dependsOn(":grpc-common-spring-boot:javadoc") } - source = delombok.outputDir + source = delombok failOnError = false options.locale = 'en_US' options.encoding = 'UTF-8' diff --git a/gradle.properties b/gradle.properties index 5d7f9d869..7d4d719c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,3 +5,9 @@ org.gradle.caching=true org.gradle.vfs.watch=true org.gradle.daemon=true +# for spotless java 16 compatibility: https://github.com/diffplug/spotless/issues/834 +org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ + --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ No newline at end of file From ea27bb625d65773f95c4746d8c8c729e48883af1 Mon Sep 17 00:00:00 2001 From: Andrey Popfalushi Date: Thu, 13 May 2021 23:08:39 +0300 Subject: [PATCH 2/3] Java 16 + gradle 7.0.1 compatibility --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 959adb716..ffe09f4a1 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ if (hasProperty('buildScan')) { wrapper { // Update using: // ./gradlew wrapper --gradle-version=6.5 --distribution-type=bin - gradleVersion = '7.0' + gradleVersion = '7.0.1' } def buildTimeAndDate = OffsetDateTime.now() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f371643ee..e5338d370 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From b8c6bb29c8dd7817025617b0bb8f1d0ab38c6c31 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 22 Nov 2021 23:30:44 +0100 Subject: [PATCH 3/3] Retain java 8 support --- gradle.properties | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7d4d719c1..5d7f9d869 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,3 @@ org.gradle.caching=true org.gradle.vfs.watch=true org.gradle.daemon=true -# for spotless java 16 compatibility: https://github.com/diffplug/spotless/issues/834 -org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ - --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ - --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ - --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ - --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ No newline at end of file