jlprat commented on a change in pull request #10934:
URL: https://github.com/apache/kafka/pull/10934#discussion_r659831262



##########
File path: gradle/dependencies.gradle
##########
@@ -179,10 +183,10 @@ libs += [
   powermockEasymock: 
"org.powermock:powermock-api-easymock:$versions.powermock",
   reflections: "org.reflections:reflections:$versions.reflections",
   rocksDBJni: "org.rocksdb:rocksdbjni:$versions.rocksDB",
-  scalaCollectionCompat: 
"org.scala-lang.modules:scala-collection-compat_$versions.baseScala:$versions.scalaCollectionCompat",
-  scalaJava8Compat: 
"org.scala-lang.modules:scala-java8-compat_$versions.baseScala:$versions.scalaJava8Compat",
   scalaLibrary: "org.scala-lang:scala-library:$versions.scala",
-  scalaLogging: 
"com.typesafe.scala-logging:scala-logging_$versions.baseScala:$versions.scalaLogging",
+  scala3Library: "org.scala-lang:scala3-library_3:3.0.0",

Review comment:
       I can add a couple of extra variables, but please notice that the 
library changed in the name as well:
   it's `scala3-library_3:3.0.0` vs. `scala-library_2.13:2:13.16
   Notice the extra `3` right after `scala`.

##########
File path: gradle/dependencies.gradle
##########
@@ -179,10 +183,10 @@ libs += [
   powermockEasymock: 
"org.powermock:powermock-api-easymock:$versions.powermock",
   reflections: "org.reflections:reflections:$versions.reflections",
   rocksDBJni: "org.rocksdb:rocksdbjni:$versions.rocksDB",
-  scalaCollectionCompat: 
"org.scala-lang.modules:scala-collection-compat_$versions.baseScala:$versions.scalaCollectionCompat",
-  scalaJava8Compat: 
"org.scala-lang.modules:scala-java8-compat_$versions.baseScala:$versions.scalaJava8Compat",
   scalaLibrary: "org.scala-lang:scala-library:$versions.scala",
-  scalaLogging: 
"com.typesafe.scala-logging:scala-logging_$versions.baseScala:$versions.scalaLogging",
+  scala3Library: "org.scala-lang:scala3-library_3:3.0.0",

Review comment:
       I had something like this on my early attempts, but I went for this as 
it was "clearer" for the reviewer. I go back to that

##########
File path: gradle/dependencies.gradle
##########
@@ -23,22 +23,26 @@ ext {
 
   // Available if -PscalaVersion is used. This is useful when we want to 
support a Scala version that has
   // a higher minimum Java requirement than Kafka. This was previously the 
case for Scala 2.12 and Java 7.
-  availableScalaVersions = [ '2.12', '2.13' ]
+  availableScalaVersions = [ '2.13', '3.0' ]
 }
 
 // Add Scala version
-def defaultScala212Version = '2.12.14'
 def defaultScala213Version = '2.13.6'
+def defaultScala30Version = '3.0.0'
 if (hasProperty('scalaVersion')) {
-  if (scalaVersion == '2.12') {
-    versions["scala"] = defaultScala212Version
-  } else if (scalaVersion == '2.13') {
+  if (scalaVersion == '2.13') {
     versions["scala"] = defaultScala213Version
+  } else if (scalaVersion == '3.0') {
+    versions["scala"] = defaultScala30Version
+    versions["baseScala"] = '3'
+    versions["baseScalaJackson"] = '2.13'
+    versions["postfixScala"] = '3'
+    versions["postfixScalaOptionalVersion"] = '_3'

Review comment:
       @ijuma that is what I meant with not so readable. As both prefixes are 
only present on Scala 3 and they have different syntax (one with `_`, the other 
without) I need this somewhat ugly code.
   
   Please note, this might go away eventually if Gradle supports Scala 3: 
https://github.com/gradle/gradle/issues/16527




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to