Skip to content

Commit

Permalink
MINOR: Pass -release 8 to scalac and upgrade to Gradle 6.4 (apache#…
Browse files Browse the repository at this point in the history
…8538)

The version of Zinc included with Gradle 6.4 includes a fix for the blocker
that was preventing us from passing `-release 8` to scalac.

Release notes for Gradle 6.4:

https://docs.gradle.org/6.4/release-notes.html

Reviewers: Manikumar Reddy <[email protected]>
  • Loading branch information
ijuma authored May 6, 2020
1 parent 3b6bf80 commit 1d43803
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ See our [web site](https://kafka.apache.org) for details on the project.

You need to have [Java](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed.

Java 8 should be used for building in order to support both Java 8 and Java 11 at runtime.
We build and test Apache Kafka with Java 8, 11 and 14. We set the `release` parameter in javac and scalac
to `8` to ensure the generated binaries are compatible with Java 8 or higher (independently of the Java version
used for compilation).

Scala 2.13 is used by default, see below for how to use a different Scala version or all of the supported Scala versions.

Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,10 @@ subprojects {
]
}

// Scalac's `-release` requires Java 9 or higher
if (JavaVersion.current().isJava9Compatible())
scalaCompileOptions.additionalParameters += ["-release", minJavaVersion]

configure(scalaCompileOptions.forkOptions) {
memoryMaximumSize = '1g'
jvmArgs = ['-Xss4m']
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ versions += [
bcpkix: "1.64",
checkstyle: "8.20",
commonsCli: "1.4",
gradle: "6.3",
gradle: "6.4",
gradleVersionsPlugin: "0.28.0",
grgit: "4.0.1",
httpclient: "4.5.11",
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 1d43803

Please sign in to comment.