ScalaJS 插件 0.6.23:"value %%% is not a member of String"
ScalaJS plugin 0.6.23: "value %%% is not a member of String"
从 0.6.21
迁移到 ScalaJS 0.6.23
后:
(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)
release notes of Scala.js 0.6.23 说
Usages of %%%
in .scala
files of an sbt build (under project/
) need a new import:
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
For .sbt
files, this import is automatically added, so nothing changes.
所以你需要添加
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
在您的 Settings.scala
文件中。
从 0.6.21
迁移到 ScalaJS 0.6.23
后:
(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)
release notes of Scala.js 0.6.23 说
Usages of
%%%
in.scala
files of an sbt build (underproject/
) need a new import:import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
For
.sbt
files, this import is automatically added, so nothing changes.
所以你需要添加
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
在您的 Settings.scala
文件中。