ScalaJS plugin 0.6.23: "value %%% is not a member of String"
Asked Answered
G

1

7

After migrating to ScalaJS 0.6.23 from 0.6.21:

(addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.23"))

My sbt-build throws the following exception:

...
[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"
...

This is the value from the 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"
    , ...
  ))

And this is how it is used in build.sbt:

lazy val client = (project in file("client"))
  .settings(sharedSettings(Some("client")))
  .settings(clientSettings)
  .settings(clientDependencies)
  .settings(jsSettings)
  .enablePlugins(ScalaJSWeb)
  .dependsOn(sharedJs)

This is the project: https://github.com/pme123/scala-adapters

Gillead answered 9/6, 2018 at 11:24 Comment(0)
R
10

The release notes of Scala.js 0.6.23 say that

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.

So you need to add

import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

in your Settings.scala file.

Rosinski answered 9/6, 2018 at 11:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.