我正在写一个SBT Auto Plugin。这是我的build.sbt文件
lazy val foo = (project in file(".")).settings(
name := "foo",
sbtPlugin := true,
organization := "com.foo",
crossScalaVersions = Seq("2.11.8", "2.12.4")
)
但我收到了错误
overloaded method value settings with alternatives:
(ss: sbt.Def.SettingsDefinition*)sbt.Project <and>
=> Seq[sbt.Def.Setting[_]]
cannot be applied to (sbt.Def.Setting[String], sbt.Def.Setting[Boolean], sbt.Def.Setting[String], crossScalaVersions: Seq[String])
lazy val foo = (project in file(".")).settings(
^
[error] sbt.compiler.EvalException: Type error in expression
[error] sbt.compiler.EvalException: Type error in expression
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i
我的目标是,当我sbt publish
时,我发布了两个jar文件。一个用于scala 2.11,另一个用于scala 2.12
答案 0 :(得分:4)
您必须提供crossScalaVersions := Seq("2.11.8", "2.12.4")
而不是crossScalaVersions = Seq("2.11.8", "2.12.4")
。
您可以在此处查看更多Cross-Building a Project。