Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ buildscript {
}

plugins {
id 'com.diffplug.spotless' version '6.13.0'
id 'com.diffplug.spotless' version '6.13.0' // newer versions require Java 11, so we can't use them until Kafka 4.0
id 'com.github.ben-manes.versions' version '0.44.0'
id 'idea'
id 'java-library'
Expand All @@ -54,7 +54,7 @@ spotless {

ext {
gradleVersion = versions.gradle
minJavaVersion = "8"
minJavaVersion = 8
buildVersionFileName = "kafka-version.properties"

defaultMaxHeapSize = "2g"
Expand Down Expand Up @@ -254,9 +254,6 @@ subprojects {
fineTuneEclipseClasspathFile(eclipse, project)
}

sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion

java {
consistentResolution {
// resolve the compileClasspath and then "inject" the result of resolution as strict constraints into the runtimeClasspath
Expand All @@ -273,11 +270,15 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"

// --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
// set --source and --target via `sourceCompatibility` and `targetCompatibility`. If/when Gradle supports `--release`
// natively (https://github.com/gradle/gradle/issues/2510), we should switch to that.
if (JavaVersion.current().isJava9Compatible())
options.compilerArgs << "--release" << minJavaVersion
// set --source and --target via `sourceCompatibility` and `targetCompatibility`.
if (JavaVersion.current().isJava9Compatible()) {
options.release = minJavaVersion
} else {
sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion
}
}

if (shouldPublish) {
Expand Down Expand Up @@ -680,9 +681,12 @@ subprojects {
]
}

// Scalac's `-release` requires Java 9 or higher
if (JavaVersion.current().isJava9Compatible())
scalaCompileOptions.additionalParameters += ["-release", minJavaVersion]
// Scalac 2.12 `-release` requires Java 9 or higher, but Scala 2.13 doesn't have that restriction
if (versions.baseScala == "2.13")
scalaCompileOptions.additionalParameters += ["-release:" + minJavaVersion] // Use `:` here to workaround Gradle bug (see https://github.com/gradle/gradle/issues/23962#issuecomment-1437348400)
else if (JavaVersion.current().isJava9Compatible())
scalaCompileOptions.additionalParameters += ["-release", String.valueOf(minJavaVersion)] // Don't use `:` here as it breaks compilation with Scala 2.12


configure(scalaCompileOptions.forkOptions) {
memoryMaximumSize = defaultMaxHeapSize
Expand Down Expand Up @@ -2111,7 +2115,6 @@ project(':streams:streams-scala') {
dependsOn 'copyDependantLibs'
}

test.dependsOn(':spotlessScalaCheck')
}

project(':streams:test-utils') {
Expand Down
4 changes: 2 additions & 2 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ versions += [
checkstyle: "8.36.2",
commonsCli: "1.4",
dropwizardMetrics: "4.1.12.1",
gradle: "7.6",
gradle: "8.0.1",
grgit: "4.1.1",
httpclient: "4.5.13",
easymock: "4.3",
jackson: "2.13.4",
jacksonDatabind: "2.13.4.2",
jacoco: "0.8.7",
jacoco: "0.8.8",
javassist: "3.27.0-GA",
jetty: "9.4.48.v20220622",
jersey: "2.34",
Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha=312eb12875e1747e05c2f81a4789902d7e4ec5defbd1eefeaccc08acf096505d
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionSha=948d1e4ccc2f6ae36cbfa087d827aaca51403acae5411e664a6000bb47946f22
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 14 additions & 10 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.