Skip to content
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

Support Scala 3 #112

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion lib/scala.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
def scala212 = projectsWithFlags('scala_2.12')
def scala213 = projectsWithFlags('scala_2.13')
def scala3 = projectsWithFlags('scala_3')

configure(scala212 + scala213) {
configure(scala212 + scala213 + scala3) {

apply plugin: 'scala'

Expand Down Expand Up @@ -64,12 +65,37 @@ configure(scala212) {
}
testImplementation 'org.scalameta:munit_2.12'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.with {
// A workaround for 'jvm-1.16' is not a valid choice for '-target'. bad option: '-target:jvm-1.16'
// Toolchain passes a wrong target parameter to the Scala compiler.
// - https://github.com/gradle/gradle/issues/19456
// - https://github.com/gradle/gradle/pull/18347
additionalParameters = [ '-target:jvm-1.8']
}
}
}

configure(scala213) {
dependencies {
implementation 'org.scala-lang:scala-library'
testImplementation 'org.scalameta:munit_2.13'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.with {
additionalParameters = [ '-target:1.8']
}
}
}

configure(scala3) {
dependencies {
implementation 'org.scala-lang:scala3-library_3'
testImplementation 'org.scalameta:munit_3'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.with {
additionalParameters = [ '-release:8']
}
}
}