[英]scala: how to cross build the library dependency in sbt
i am using scala 2.13
and i have to use Gatling load tests , Gatling does not support Scala-2.13
for that i looked into sbt cross build and how to cross build library dependency i have two Gatling dependencies我正在使用
scala 2.13
,我必须使用Gatling 负载测试,Gatling 不支持Scala-2.13
,因为我研究了sbt 交叉构建以及如何交叉构建库依赖项我有两个 Gatling 依赖项
"io.gatling.highcharts" % "gatling-charts-highcharts" % "3.3.1",
"io.gatling" % "gatling-test-framework" % "3.3.1"
these libraries support Scala 2.12
for that i am doing something like this build.sbt这些库支持
Scala 2.12
因为我正在做这样的事情 build.sbt
lazy val scala212 = "2.12.10"
lazy val scala213 = "2.13.1"
scalaVersion := scala213
lazy val supportedScalaVersions = List(scala213, scala212)
lazy val root = (project in file("."))
.settings(
crossScalaVersions := supportedScalaVersions,
)
libraryDependencies ++= Seq(
"org.mongodb.scala" %% "mongo-scala-driver" % "2.8.0",
"com.typesafe.akka" %% "akka-actor" % "2.6.3",
"com.typesafe.akka" %% "akka-stream" % "2.6.3"
)
libraryDependencies ++= (scalaBinaryVersion.value match {
case "2.12.10" => Seq(
"io.gatling.highcharts" % "gatling-charts-highcharts" % "3.3.1",
"io.gatling" % "gatling-test-framework" % "3.3.1"
)
case _ => Seq()
}
)
Sbt
is not downloading the Gatling dependencies and sbt update
command does not show any error it looks like the case 2.12.10 match
part is not even executed Sbt
没有下载 Gatling 依赖项并且sbt update
命令没有显示任何错误,看起来case 2.12.10 match
部分甚至没有执行
what is the right way to do this ?这样做的正确方法是什么? i want to write Gatling simulations in test directory
我想在测试目录中编写加特林模拟
You got it almost right but scalaBinaryVersion
is 2.12
in your case.你说得差不多了,但在你的情况下,
scalaBinaryVersion
是2.12
。 scalaVersion.value
is what you are looking for. scalaVersion.value
是您正在寻找的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.