У меня есть проект sbt Scala, построенный на scala 2.13.1. Я хочу построить его с scala -2.12.8 из-за некоторой поддержки зависимостей библиотеки только для scala 2.12 после некоторого исследования этот вопрос - это именно тот случай, когда я следовал за ответом, но я получаю сообщение об ошибке
error] scala.MatchError: Some((2,13)) (of class scala.Some)
[error] at $97a4428383eb69f53d6e$.$anonfun$$sbtdef$1(/home/sara/git/gitinterpret/interpret/build.sbt:56)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.EvaluateSettings$MixedNode.evaluate0(INode.scala:221)
[error] at sbt.internal.util.EvaluateSettings$INode.evaluate(INode.scala:164)
[error] at sbt.internal.util.EvaluateSettings.$anonfun$submitEvaluate$1(INode.scala:87)
[error] at sbt.internal.util.EvaluateSettings.sbt$internal$util$EvaluateSettings$$run0(INode.scala:98)
[error] at sbt.internal.util.EvaluateSettings$$anon$3.run(INode.scala:94)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] at java.base/java.lang.Thread.run(Thread.java:834)
[error] scala.MatchError: Some((2,13)) (of class scala.Some)
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
вот мой build.sbt
lazy val scala212 = "2.12.8"
lazy val scala213 = "2.13.1"
scalaVersion := scala213
lazy val supportedScalaVersions = List(scala213, scala212)
lazy val root = (project in file("."))
.settings(
crossScalaVersions := supportedScalaVersions,
)
libraryDependencies := { CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2,scalaMajor)) if scalaMajor == 12.8 =>
libraryDependencies.value ++ Seq(
"org.scala-lang" % "scala-library" % "2.12.8",
"org.mongodb.scala" %% "mongo-scala-driver" % "2.8.0"
"io.gatling.highcharts" % "gatling-charts-highcharts" % "3.3.1" % "test"
case Some((2,scalaMajor)) if scalaMajor == 13.1 =>
libraryDependencies.value ++ Seq(
"org.scala-lang" % "scala-library" % "2.13.1",
"org.mongodb.scala" %% "mongo-scala-driver" % "2.8.0",
"com.typesafe.akka" %% "akka-actor" % "2.6.3",
)
}
}