Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use doodle's GitHub master as a RootProject in sbt #16

Closed
xanderdunn opened this issue Aug 5, 2015 · 4 comments
Closed

Unable to use doodle's GitHub master as a RootProject in sbt #16

xanderdunn opened this issue Aug 5, 2015 · 4 comments

Comments

@xanderdunn
Copy link

I'm attempting to configure my project's build.sbt so that it depends on doodle's master GitHub branch so that I can make use of your latest additions to animations:

lazy val doodleProject = RootProject(uri("https://github.com/underscoreio/doodle.git"))
//lazy val doodleProject = RootProject( uri("git://github.com/dragos/dupcheck.git") )

lazy val root = (project in file("."))
  .settings(
    name := "gridworld",
    version := "1.0",
    scalaVersion := "2.11.7",
    //resolvers += "Underscore Training" at "https://dl.bintray.com/underscoreio/training",
    //libraryDependencies += "underscoreio" %% "doodle" % "0.1.0",
    initialCommands in console := """
      |import doodle.core._
      |import doodle.syntax._
      |import doodle.jvm._
      |import doodle.examples._
    """.trim.stripMargin
  )
  .dependsOn(doodleProject)

With this configuration, running sbt will give this error:

[info] Loading project definition from /Users/admin/.sbt/0.13/staging/bc969347ae8d770695a8/doodle/project
java.lang.AssertionError: assertion failed: Directory /local/dev/gridworld/js is not contained in build root /Users/admin/.sbt/0.13/staging/bc969347ae8d770695a8/doodle
        at scala.Predef$.assert(Predef.scala:179)
        at sbt.Load$.checkProjectBase(Load.scala:345)
        at sbt.Load$.sbt$Load$$resolve$1(Load.scala:380)
        at sbt.Load$$anonfun$resolveBase$1.apply(Load.scala:383)
        at sbt.Load$$anonfun$resolveBase$1.apply(Load.scala:383)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
        at scala.collection.AbstractTraversable.map(Traversable.scala:105)
        at sbt.Load$.projects(Load.scala:407)
        at sbt.Load$.loaded(Load.scala:308)
        at sbt.Load$.loadAll(Load.scala:334)
        at sbt.Load$.loadURI(Load.scala:289)
        at sbt.Load$.load(Load.scala:285)
        at sbt.Load$.load(Load.scala:276)
        at sbt.Load$.apply(Load.scala:130)
        at sbt.Load$.defaultLoad(Load.scala:36)
        at sbt.BuiltinCommands$.doLoadProject(Main.scala:481)
        at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:475)
        at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:475)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:58)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:58)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60)
        at sbt.Command$.process(Command.scala:92)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.State$$anon$1.process(State.scala:184)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.MainLoop$.next(MainLoop.scala:98)
        at sbt.MainLoop$.run(MainLoop.scala:91)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
        at sbt.Using.apply(Using.scala:24)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
        at sbt.MainLoop$.runLogged(MainLoop.scala:24)
        at sbt.StandardMain$.runManaged(Main.scala:53)
        at sbt.xMain.run(Main.scala:28)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
        at xsbt.boot.Launch$.run(Launch.scala:109)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
        at xsbt.boot.Launch$.launch(Launch.scala:117)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:41)
        at xsbt.boot.Boot$.main(Boot.scala:17)
        at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.AssertionError: assertion failed: Directory /local/dev/gridworld/js is not contained in build root /Users/admin/.sbt/0.13/staging/bc969347ae8d770695a8/doodle
[error] Use 'last' for the full log.

I'm new to sbt, so I could easily be doing something wrong. However, if I switch out the RootProject with the example given in the sbt docs, then running sbt works just fine:

lazy val doodleProject = RootProject( uri("git://github.com/dragos/dupcheck.git") )
@xanderdunn
Copy link
Author

I tried cloning the doodle repository myself and then referencing it locally:

lazy val doodleProject = RootProject(file("./doodle"))

Same result.

@noelwelsh
Copy link
Contributor

I haven't seen this error before. My guess, from the line

Directory /local/dev/gridworld/js is not contained in build root

is it has something to do with the Scala.js plugin. If you don't already have it in your project you might try adding it. See https://github.com/underscoreio/doodle/blob/develop/project/plugins.sbt for the configuration that Doodle uses. You should only need

resolvers ++= Seq(
  Resolver.bintrayRepo("scala-js", "scala-js-releases")
)

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

If this doesn't help I would try asking on the sbt mailing list or Gitter channel https://gitter.im/sbt/sbt

@xanderdunn
Copy link
Author

From help on the sbt Gitter channel, apparently sbt-scalajs' cross building functionality is not compatible with sbt 0.13.8's added support for cross-Scala version sources and requires it to be re-set verbosely: https://github.com/InTheNow/export-hook/commit/22536a24f63eed647ce0ebd072758c752c88b1cc#commitcomment-12523097

Now I'm just trying to figure out how to apply this to my situation. Or, perhaps roll back sbt to 0.13.7.

@xanderdunn
Copy link
Author

It doesn't look like there's a clear workaround to this right now. It isn't actually solved by using a lower version of sbt:
screen shot 2015-08-05 at 17 36 24

@xanderdunn xanderdunn changed the title Can't use doodle's GitHub branch as a RootProject in sbt Unable to use doodle's GitHub master as a RootProject in sbt Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants