I'm wanting to have a bridge for Scala.js and Snap.svg in an sbt project, but also including demo code for the bridge.
When doing demos/compile
sbt starts to say that it cannot resolve the dependency. It looks like it's trying to reach the bridge as if it was a publicized, external project but it's right here, and it compiles.
What am I doing wrong?
Removing the publishing-specific files does not seem to bring a change.
Directory structure:
├── build.sbt ├── project │ ├── (PublishToBintray.scala) │ ├── build.properties │ ├── build.sbt │ ├── project │ │ └── ... │ └── target │ │ └── ... ├── (publishing.sbt) ├── scalajs_demos │ ├── main │ │ └── scala │ │ └── clock.scala │ └── target │ └── ... ├── src │ └── main │ └── scala │ └── org │ └── scalajs │ └── snapsvg │ ├── SnapSvg.scala │ └── package.scala └── target └── ...
build.sbt:
scalaJSSettings
name := "Scala.js Snap.svg"
normalizedName := "scalajs-snapsvg"
version := "0.01"
organization := "org.scala-lang.modules.scalajs"
scalaVersion := "2.11.1"
crossScalaVersions := Seq("2.10.4", "2.11.1") // note: not tested with 2.10.x
libraryDependencies +=
"org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6" // TBD: probably need it, just like jQuery bridge does
ScalaJSKeys.jsDependencies +=
"org.webjars" % "Snap.svg" % "0.3.0" / "snap.svg.js"
homepage := Some(url("http://snapsvg.io/"))
licenses += ("Apache 2.0", url("https://github.com/adobe-webplatform/Snap.svg/blob/master/LICENSE"))
//---
// bridge (main) project
//
lazy val bridge = project.in( file(".") )
//---
// demos project
//
lazy val demos = project.in( file("scalajs_demos") ).dependsOn(bridge)
What goes wrong in sbt:
> demos/compile [info] Updating {file:/Users/asko/Hg/scala-js-snapsvg/}demos... [info] Resolving org.scala-lang.modules.scalajs#scalajs-snapsvg_sjs0.5_2.10;0.01 ... [warn] module not found: org.scala-lang.modules.scalajs#scalajs-snapsvg_sjs0.5_2.10;0.01 [warn] ==== local: tried [warn] /Users/asko/.ivy2/local/org.scala-lang.modules.scalajs/scalajs-snapsvg_sjs0.5_2.10/0.01/ivys/ivy.xml [warn] ==== public: tried [warn] http://repo1.maven.org/maven2/org/scala-lang/modules/scalajs/scalajs-snapsvg_sjs0.5_2.10/0.01/scalajs-snapsvg_sjs0.5_2.10-0.01.pom [info] Resolving org.fusesource.jansi#jansi;1.4 ... [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: org.scala-lang.modules.scalajs#scalajs-snapsvg_sjs0.5_2.10;0.01: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [trace] Stack trace suppressed: run last demos/*:update for the full output. [error] (demos/*:update) sbt.ResolveException: unresolved dependency: org.scala-lang.modules.scalajs#scalajs-snapsvg_sjs0.5_2.10;0.01: not found [error] Total time: 0 s, completed 27.7.2014 22:57:22 >
One more thing, the project/plugins.sbt
:
addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.0")
% "test->test"
in.dependsOn(bridge % "test->test")
? It seems like you want a dependencies between thecompile
configurations (no%
needed), not from the test config to the test config. – sjrd