-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-16237: Add Scala 3 support for Kafka Streams #15338
base: trunk
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mberndt123 for your PR
gradlewAll
needs to be modified as well. But as I mentioned in the mailing list, I think it would be beneficial to start a "DISCUSS" thread with this proposal, as there are a couple of things we might want to align.
build.gradle
Outdated
@@ -2355,7 +2366,7 @@ project(':streams:streams-scala') { | |||
spotless { | |||
scala { | |||
target '**/*.scala' | |||
scalafmt("$versions.scalafmt").configFile('../../checkstyle/.scalafmt.conf').scalaMajorVersion(versions.baseScala) | |||
scalafmt("$versions.scalafmt").configFile('../../checkstyle/.scalafmt.conf').scalaMajorVersion('2.13') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation for this change? This means that we would run scalafmt with 2.13 rules regardless of the Scala version we compile. I think we could use something like https://scalameta.org/scalafmt/docs/configuration.html#scala-2-with--xsource3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a leftover from an old version.
Originally I using the same scalaVersion
for both Kafka-Streams-Scala and Core, and there is no Scala 3 artifact for scalafmt yet, so it wasn't working.
But since now I'm using separate versions, I'll undo this change.
gradle.properties
Outdated
@@ -31,3 +31,5 @@ swaggerVersion=2.2.8 | |||
task=build | |||
org.gradle.jvmargs=-Xmx2g -Xss4m -XX:+UseParallelGC | |||
org.gradle.parallel=true | |||
|
|||
streamsScalaVersion=3.3.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I've removed it
Co-authored-by: Josep Prat <josep.prat@aiven.io>
The only reasonable change would be to add |
@mberndt123 one of the possible solutions may be to attach the Scala 3 related step as a piggyback to Scala 2.13, it will be skipped when |
Any chance of getting this merged? |
A port of Kafka-Streams-Scala.
The code itself was almost entirely compatible, most of the work revolves around the build system.
Because core doesn't yet support Scala 3, it's necessary to specify the Scala version for the two separately, so there is now a
streamsScalaVersion
in addition toscalaVersion
.The two versions need to be compatible though because the Kafka-Streams-Scala tests have a dependency on the Core project. Fortunately Scala 2.13 and Scala 3 can coexist on the classpath, so the tests will run even when compiling with different Scala versions.
The Scala compiler options for Scala 3 are largely incompatible with the Scala 2.13 ones, so I've set them to
[]
for now as I don't know what the preferences of the Kafka developers are regarding that.