kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Extract SCALA_BINARY_VERSION from SCALA_VERSION
Date Thu, 17 Nov 2016 02:15:19 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 249e41368 -> aad938406


MINOR: Extract SCALA_BINARY_VERSION from SCALA_VERSION

Will allow users to set one fewer environment variable if they need to
change scala version. Still, SCALA_BINARY_VERSION can be explicitly set.

Author: Konstantine Karantasis <konstantine@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #2130 from kkonstantine/MINOR-Extract-SCALA_BINARY_VERSION-from-SCALA_VERSION


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/aad93840
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/aad93840
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/aad93840

Branch: refs/heads/trunk
Commit: aad93840668ae895fce5762c2491b09c32bc3e0c
Parents: 249e413
Author: Konstantine Karantasis <konstantine@confluent.io>
Authored: Thu Nov 17 02:15:14 2016 +0000
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Thu Nov 17 02:15:14 2016 +0000

----------------------------------------------------------------------
 README.md                       |  2 +-
 bin/kafka-run-class.sh          |  2 +-
 bin/windows/kafka-run-class.bat | 10 +++++++++-
 3 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/aad93840/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index b7f9f4f..e65bfc2 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ The release file can be found inside `./core/build/distributions/`.
     ./gradlew clean
 
 ### Running a task on a particular version of Scala (either 2.10.6 or 2.11.8) ###
-*Note that if building the jars with a version other than 2.10, you need to set the `SCALA_BINARY_VERSION`
variable or change it in `bin/kafka-run-class.sh` to run the quick start.*
+*Note that if building the jars with a version other than 2.10.6, you need to set the `SCALA_VERSION`
variable or change it in `bin/kafka-run-class.sh` to run the quick start.*
 
 You can pass either the major version (eg 2.11) or the full version (eg 2.11.8):
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/aad93840/bin/kafka-run-class.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index 1f5140b..41c75eb 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -52,7 +52,7 @@ if [ -z "$SCALA_VERSION" ]; then
 fi
 
 if [ -z "$SCALA_BINARY_VERSION" ]; then
-  SCALA_BINARY_VERSION=2.10
+  SCALA_BINARY_VERSION=$(echo $SCALA_VERSION | cut -f 1-2 -d '.')
 fi
 
 # run ./gradlew copyDependantLibs to get all dependant jars in a local dir

http://git-wip-us.apache.org/repos/asf/kafka/blob/aad93840/bin/windows/kafka-run-class.bat
----------------------------------------------------------------------
diff --git a/bin/windows/kafka-run-class.bat b/bin/windows/kafka-run-class.bat
index 030c9b7..9e4c865 100644
--- a/bin/windows/kafka-run-class.bat
+++ b/bin/windows/kafka-run-class.bat
@@ -31,7 +31,15 @@ IF ["%SCALA_VERSION%"] EQU [""] (
 )
 
 IF ["%SCALA_BINARY_VERSION%"] EQU [""] (
-  set SCALA_BINARY_VERSION=2.10
+  for /f "tokens=1,2 delims=." %%a in ("%SCALA_VERSION%") do (
+    set FIRST=%%a
+    set SECOND=%%b
+    if ["!SECOND!"] EQU [""] (
+      set SCALA_BINARY_VERSION=!FIRST!
+    ) else (
+      set SCALA_BINARY_VERSION=!FIRST!.!SECOND!
+    )
+  )
 )
 
 rem Classpath addition for kafka-core dependencies


Mime
View raw message