I would like to have the following SBT assembly design:
object MyBuild extends Build { lazy val core = Project("core", file("core")) .dependsOn(testkit % "test") lazy val testkit = Project("testkit", file("testkit")) .dependsOn(core % "compile") }
When core is the main module, including domain objects, and testkit is a module for testing support code (collectors, mappings, test drivers, etc., and not the tests themselves), which depend on domain objects and other / utils classes in core .
SBT gives a Cyclic reference error for this setting, although in fact there is no cyclic dependency due to the use of various configurations ( core compiles, then testkit compiles depending on core , then core test compiles depending on both).
I found a dirty way around this problem by replacing one of dependsOn use unmanagedClasspath , for example:
.settings(unmanagedClasspath in Compile <+= (packageBin in (LocalProject("core"), Compile)))
This seems like a hack, and also makes sbt-idea generate the wrong IntelliJ projects (by the way).
Any idea for a better solution? Does SBT support this structure?
source share