These are chat archives for sbt/sbt

5th
Aug 2015
Miles Sabin
@milessabin
Aug 05 2015 09:14
Is there way of specifying in a .sbt file that sbt should start in a particular non-root project?
Dale Wijnand
@dwijnand
Aug 05 2015 09:16
The way I know is not pretty, but works:
onLoad in Global := (onLoad in Global).value andThen (Command.process(s"project someNonRootProject", _: State))
Miles Sabin
@milessabin
Aug 05 2015 09:22
@dwijnand perfect ... thanks :-)
Josh Suereth
@jsuereth
Aug 05 2015 13:34
@milessabin Jacek was working on that feature, but unfortunately, I think he needed some more guidance and ran out of time. Maybe we should check to see if there is a ticket for enhancement aroudn that and get some kind of setting up and running so we can do it
Miles Sabin
@milessabin
Aug 05 2015 14:01
@dwijnand's suggestion did the trick for me. I think just documenting that would be fine.
Dale Wijnand
@dwijnand
Aug 05 2015 14:25
@jsuereth I guess you mean sbt/sbt#1224 / sbt/sbt#1305
Josh Suereth
@jsuereth
Aug 05 2015 14:35
yep
Perry
@pfn
Aug 05 2015 15:12
I have a similar sort of need, I have a multiproject build that has multiple projects on the same base directory; sbt seems to pick a random or first-alphabetical project name as default
I haven't quite figured out
Josh Suereth
@jsuereth
Aug 05 2015 15:12
@pfn THink it should be first-alphabetical
IIRC the code
Perry
@pfn
Aug 05 2015 15:15
and I also wrote a similar onload handler
Dale Wijnand
@dwijnand
Aug 05 2015 15:16
thought we had this conversation a few months ago, but it turns out that was about *.sbt file ordering, see http://stackoverflow.com/a/30260633/463761
Perry
@pfn
Aug 05 2015 15:17
onLoad in Global := {
  { (state: State) =>
    val nav = new ProjectNavigation(state)
    if ("pro" != Project.extract(state).currentRef.project)
      nav.selectProject(nav.rootRef.build, "pro")
    else state
  } compose (onLoad in Global).value
}
much more verbose than what @dwijnand said earlier though
man, I haven't even started the project yet and my build file is so huge
Gerrit
@gvd
Aug 05 2015 17:32
In order to get around a resolving issue I set the fullResolvers in one of my projects. However, this prevents me from having dependencies between projects (by using dependsOn). Can I add the inter project resolver manually to fullResolvers?
Gerrit
@gvd
Aug 05 2015 17:49
Ah I just figured out that I can add projectResolver.value to fullResolvers
Xander Dunn
@xanderdunn
Aug 05 2015 19:22
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)
New to gitter. Didn't mean to send that yet.
In any case, with the above build.sbt, I get this error when running sbt: [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
I'm able to compile and run the doodle project individually. If I cd into its directory and run sbt, then it's fine. However, trying it as a dependency on my project is not working.
Josh Suereth
@jsuereth
Aug 05 2015 19:47
What's the build look like for doodle.git?
Xander Dunn
@xanderdunn
Aug 05 2015 20:04
Josh Suereth
@jsuereth
Aug 05 2015 20:20
hmm, I'm not seeing any reason there, but it may be a bad interaction with scala.js plugin and RootProject
Dale Wijnand
@dwijnand
Aug 05 2015 20:26
Yeah found out sbt-scalajs breaks 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
Josh Suereth
@jsuereth
Aug 05 2015 20:31
interesting, I need to dive into that soon
I'm currently in type/compiler hell
Dale Wijnand
@dwijnand
Aug 05 2015 20:35
macro fun, huh? :D
Xander Dunn
@xanderdunn
Aug 05 2015 20:44
@dwijnand Thanks a lot for that. I'm new to sbt, so I'm thinking about how to apply this to my situation. It looks like I need to define a cross project and then depend on it: crossProject.crossType(CrossType.Pure)
Dale Wijnand
@dwijnand
Aug 05 2015 20:58
np
Xander Dunn
@xanderdunn
Aug 05 2015 22:33
Even if I set my project set build with sbt-0.13.7, I still get the same error: /local/dev/gridworld/js is not contained in build root /Users/admin/.sbt/0.13/staging/bc969347ae8d770695a8/doodle
*set my project to build with
Same build with 0.13.6.
Josh Suereth
@jsuereth
Aug 05 2015 22:42
Yeah, I'm guessing it's a scala.js thing
I'll have to look into their plugin
Basically, I'd expect they're using a file(".") somewhere
which isn't safe across RootProject reference
so it's an actual bug
I'll have to see why sbt's relative-file-directory handling isn't detecting this correctly, could be some fun macro interactions
Xander Dunn
@xanderdunn
Aug 05 2015 23:05
Thanks for looking into it. 👍🏻