Skip to content

Commit d0ad9f1

Browse files
Fix Java toolchain usage (#197)
1 parent b715d5b commit d0ad9f1

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

admin-client/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ tasks.withType<GenerateTask> {
4747
}
4848

4949
tasks.withType<JavaCompile>().configureEach {
50-
targetCompatibility = "11"
51-
sourceCompatibility = "11"
52-
5350
// Disable errorprone for this module
5451
options.errorprone.disableAllChecks.set(true)
5552
}

build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,17 @@ subprojects {
8888

8989
dependencies { errorprone("com.google.errorprone:error_prone_core:2.13.1") }
9090

91+
// Configure the java toolchain to use. If not found, it will be downloaded automatically
9192
java {
9293
toolchain { languageVersion = JavaLanguageVersion.of(11) }
94+
9395
withJavadocJar()
9496
withSourcesJar()
9597
}
9698

9799
protobuf { protoc { artifact = "com.google.protobuf:protoc:$protobufVersion" } }
98100

99101
tasks.withType<JavaCompile>().configureEach {
100-
targetCompatibility = "11"
101-
sourceCompatibility = "11"
102-
103102
options.errorprone.disableWarningsInGeneratedCode.set(true)
104103
options.errorprone.disable(
105104
// We use toString() in proto messages for debugging reasons.

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
rootProject.name = "sdk-java"
1111

12+
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" }
13+
1214
include(
1315
"sdk-common",
1416
"sdk-api",

0 commit comments

Comments
 (0)