I maintain a open source bitcoin library called bitcoin-s. If you look at the build.sbt file you will see that the testkit project depends on the rpc project, and the rpc project depends on the testkit project as a publish dependency inside of our Deps.scala file.
This is unfortunate because if we change the api in the rpc project at all, we have to publish a new testkit snapshot to be able to reflect the changes in the rpc api, and then run tests in the rpc project. You can see a more detailed guide of the build process here
I would like to make it so that we can just have each project depend on each other in build.sbt with something like this:
lazy val rpc = project .in(file("rpc")) .enablePlugins() .settings(commonSettings: _*) .dependsOn( core, testkit % "test->test" ) .settings( testOptions in Test += Tests.Argument("-oF") ) lazy val bench = project .in(file("bench")) .enablePlugins() .settings(assemblyOption in assembly := (assemblyOption in assembly).value .copy(includeScala = true)) .settings(commonSettings: _*) .settings( libraryDependencies ++= Deps.bench, name := "bitcoin-s-bench" ) .dependsOn(core) lazy val eclairRpc = project .in(file("eclair-rpc")) .enablePlugins() .settings(commonSettings: _*) .dependsOn( core, rpc testkit % "test->test" ) lazy val testkit = project .in(file("testkit")) .enablePlugins() .settings(commonSettings: _*) .dependsOn( core, rpc, eclairRpc ) However this creates a circular dependency between the projects which leads to a stackoverflow when loading build.sbt.
Is there any way to avoid this? We have a very complicated process of publishing the dependency currently which ends up depending on SNAPSHOTS of the project (not full releases) as the bitcoinsV