From dbe618c63c2dab4115a45dd9503b23c14bc481b0 Mon Sep 17 00:00:00 2001 From: Ismael Juma Date: Thu, 23 Apr 2020 07:02:54 -0700 Subject: [PATCH] KAFKA-9907: Switch default build to Scala 2.13 (#8537) Scala 2.13.2 introduces support for suppressing warnings, which makes it possible to enable fatal warnings. This is useful enough from a development perspective to justify this change. In addition, Scala 2.13.2 also has a Vector implementation with significant performance improvements and encoding of String matches to switches. Reviewers: Manikumar Reddy --- README.md | 2 +- bin/kafka-run-class.sh | 2 +- bin/windows/kafka-run-class.bat | 2 +- docs/js/templateData.js | 2 +- gradle.properties | 2 +- release.py | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4dec5e410c69d..cddf7493e1967 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ You need to have [Java](http://www.oracle.com/technetwork/java/javase/downloads/ Java 8 should be used for building in order to support both Java 8 and Java 11 at runtime. -Scala 2.12 is used by default, see below for how to use a different Scala version or all of the supported Scala versions. +Scala 2.13 is used by default, see below for how to use a different Scala version or all of the supported Scala versions. ### Build a jar and run it ### ./gradlew jar diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh index 4333c9b84a003..24985e2605c68 100755 --- a/bin/kafka-run-class.sh +++ b/bin/kafka-run-class.sh @@ -48,7 +48,7 @@ should_include_file() { base_dir=$(dirname $0)/.. if [ -z "$SCALA_VERSION" ]; then - SCALA_VERSION=2.12.11 + SCALA_VERSION=2.13.2 if [[ -f "$base_dir/gradle.properties" ]]; then SCALA_VERSION=`grep "^scalaVersion=" "$base_dir/gradle.properties" | cut -d= -f 2` fi diff --git a/bin/windows/kafka-run-class.bat b/bin/windows/kafka-run-class.bat index 08cfbda456ed9..5c0c26450851b 100755 --- a/bin/windows/kafka-run-class.bat +++ b/bin/windows/kafka-run-class.bat @@ -27,7 +27,7 @@ set BASE_DIR=%CD% popd IF ["%SCALA_VERSION%"] EQU [""] ( - set SCALA_VERSION=2.12.11 + set SCALA_VERSION=2.13.2 ) IF ["%SCALA_BINARY_VERSION%"] EQU [""] ( diff --git a/docs/js/templateData.js b/docs/js/templateData.js index 3c4f480b13054..4e519479a9665 100644 --- a/docs/js/templateData.js +++ b/docs/js/templateData.js @@ -20,5 +20,5 @@ var context={ "version": "26", "dotVersion": "2.6", "fullDotVersion": "2.6.0", - "scalaVersion": "2.12" + "scalaVersion": "2.13" }; diff --git a/gradle.properties b/gradle.properties index 63f73ad7ae087..ae029f4d67fe1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,6 +21,6 @@ group=org.apache.kafka # - tests/kafkatest/version.py (variable DEV_VERSION) # - kafka-merge-pr.py version=2.6.0-SNAPSHOT -scalaVersion=2.12.11 +scalaVersion=2.13.2 task=build org.gradle.jvmargs=-Xmx1024m -Xss2m diff --git a/release.py b/release.py index 4c6c665fe73bd..bd30d24718798 100755 --- a/release.py +++ b/release.py @@ -264,7 +264,7 @@ def command_stage_docs(): cmd("Building docs", "./gradlew -Pversion=%s clean aggregatedJavadoc" % gradle_version_override, cwd=REPO_HOME, env=jdk8_env) - docs_tar = os.path.join(REPO_HOME, 'core', 'build', 'distributions', 'kafka_2.12-%s-site-docs.tgz' % gradle_version_override) + docs_tar = os.path.join(REPO_HOME, 'core', 'build', 'distributions', 'kafka_2.13-%s-site-docs.tgz' % gradle_version_override) versioned_docs_path = os.path.join(kafka_site_repo_path, docs_version(version)) if not os.path.exists(versioned_docs_path): @@ -663,8 +663,8 @@ def select_gpg_key(): Some suggested steps: * Grab the source archive and make sure it compiles: https://home.apache.org/~%(apache_id)s/kafka-%(rc_tag)s/kafka-%(release_version)s-src.tgz - * Grab one of the binary distros and run the quickstarts against them: https://home.apache.org/~%(apache_id)s/kafka-%(rc_tag)s/kafka_2.12-%(release_version)s.tgz - * Extract and verify one of the site docs jars: https://home.apache.org/~%(apache_id)s/kafka-%(rc_tag)s/kafka_2.12-%(release_version)s-site-docs.tgz + * Grab one of the binary distros and run the quickstarts against them: https://home.apache.org/~%(apache_id)s/kafka-%(rc_tag)s/kafka_2.13-%(release_version)s.tgz + * Extract and verify one of the site docs jars: https://home.apache.org/~%(apache_id)s/kafka-%(rc_tag)s/kafka_2.13-%(release_version)s-site-docs.tgz * Build a sample against jars in the staging repo: (TODO: Can we get a temporary URL before "closing" the staged artifacts?) * Validate GPG signatures on at least one file: wget https://home.apache.org/~%(apache_id)s/kafka-%(rc_tag)s/kafka-%(release_version)s-src.tgz &&