Apologies for posting to the developers mailing list, but this seems to be a question that only the experts know the answer to.
In my Build.scala, I have:
override def rootProject = Some(frontendProject)
I'm trying to convert to the newer build.sbt format, but don't know the equivalent of this line. How do I set the project for sbt to load by default when using build.sbt?
Thanks,
-Ben
--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/a77cbf42-ee49-468e-b747-b15085ece376%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Josh. I'm not sure that's what I was referring to though. In Build.scala there was a way to specify the project that's loaded when you start SBT, which was "override def rootProject". I think I figured out in build.sbt, but it's drastically more complicated:onLoad in Global := { Command.process("project root", _: State) } compose (onLoad in Global).value
override def rootProject = Some(scalajvm)
Pardon a followup from a lurker, but this thread is the closest I've found in Googling around for a solution. I've got a case where I'm trying to set the rootProject to something *other* than ".".Suffice it to say, I'm working on setting up a scala.js project, which is complex because you have multiple compiler chains involved, with one directory for compile-to-JVM, one for compile-to-JS and one for shared code, all of this driven by Play. The example I'm following uses Build.scala to say:override def rootProject = Some(scalajvm)Where the "scalajvm" Project is in the subdirectory named "scalajvm". That's the main Play driver, and it in turn depends on the parallel scalajs project to generate the Javascript output files. The root directory "." is really just a common folder holding the overall build.sbt; the scalajvm project is where the action is.(I also tried to aggregate scalajvm into a root project at the top, but that's failing -- it looks like the Play plugin doesn't cope happily with being rooted in a subproject. A naive attempt fails because of not finding the mainClass; fixing that causes further errors.)I'm trying to build a purely build.sbt version of this example (which is entirely written in Build.scala), since the consensus seems to be that that's the preferred approach nowadays, and the above line is the sticking point. I've confirmed that the Command.process() workaround works, but it looks a bit suboptimal -- a subshell feels like a bit of a hack. Is there really no way to override rootProject from a .sbt file? (Or any better way to declare that the root project is in a subdirectory?)I suspect this situation is going to become more common as scala.js gains steam. I'm hoping we can come up with a best-practice recommendation for how to structure one's build.sbt for scala.js with Play, since it is a pretty obvious combination...
Otherwise, specifying which project is root in build.sbt does not exist yet. Any chance we can see more of the build.sbt/build.scala used for Scala.js? Perhaps we can work on a canonical setup/example.
https://github.com/vmunier/play-with-scalajs-example
--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/1e6943bb-3a4a-49ed-b188-f6ecf7ec1f36%40googlegroups.com.
Well, this is kind of a big issue: https://github.com/vmunier/play-with-scalajs-example/blob/master/project/Build.scala#L75-L86
Commands are relative to projects, and this hack is quite epic. We may want to reach out between scalajs / play / sbt communities to ensure the right hooks are inplace to avoid hacks like the above, which I'm positive was causing you issues.
--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/5c05cd13-6873-46b3-b042-a7492f2a529a%40googlegroups.com.
Anything you learn in the meantime, this thread appears to be the best place until there is a scala.js ML.
--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/638265e4-4a96-4dc5-8640-d0f673e169e6%40googlegroups.com.