从0.6.23
迁移到ScalaJS 0.6.21
后:
(addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.23")
)
我的sbt
- build会抛出以下异常:
...
[error] /Users/mpa/dev/Github/pme123/scala-adapters/project/Settings.scala:88:20: value %%% is not a member of String
[error] "org.scala-js" %%% "scalajs-dom" % "0.9.6"
[error] ^
[error] /Users/mpa/dev/Github/pme123/scala-adapters/project/Settings.scala:90:27: value %%% is not a member of String
[error] , "com.typesafe.play" %%% "play-json" % "2.6.1"
...
这是Settings.scala
:
lazy val clientDependencies: Seq[Def.Setting[_]] = Def.settings(libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.6"
, "org.scala-lang.modules" %% "scala-xml" % "1.0.6"
, ...
))
这就是build.sbt
中使用它的方式:
lazy val client = (project in file("client"))
.settings(sharedSettings(Some("client")))
.settings(clientSettings)
.settings(clientDependencies)
.settings(jsSettings)
.enablePlugins(ScalaJSWeb)
.dependsOn(sharedJs)
答案 0 :(得分:6)
release notes of Scala.js 0.6.23说
sbt版本
%%%
文件中.scala
的使用情况(project/
下)需要重新导入:import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
对于
.sbt
个文件,会自动添加此导入,因此不会发生任何变化。
所以你需要添加
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
在Settings.scala
文件中。