Gradle and Scala3

Hi there, is there a easy way how to build a gradle project with Scala 3?
In other words - if I run gradle init what else I need to do to get Scala 3 working gradle project?

thank you, Tomas

1 Like

hmmm, it seems gradle doesnt support Scala 3. At least with gradle.build:

repositories {
    mavenCentral()
}

scala {
    zincVersion = "1.5.0"
}
dependencies {
    implementation group: 'org.scala-lang', name: 'scala3-library_3.0.0-RC2', version: '3.0.0-RC2'
}

application {
    mainClass = 'xhudik.hello'
}

it gives a strange error:

> Task :app:compileScala FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileScala'.
> sbt.internal.inc.AnalyzingCompiler$.compileSources(Lscala/collection/Iterable;Ljava/io/File;Lscala/collection/Iterable;Ljava/lang/String;Lsbt/internal/inc/RawCompiler;Lsbt/util/Logger;)V

there is an issue for Scala 3 support: Support for Scala3 · Issue #16527 · gradle/gradle · GitHub - hopefully will be solved soon