I'm working on a SBT multi-project solution.
Now I have:
Hierarchy like this:
test-env
I want to put some main function and object like akka ActorSystem in test-core which could be refered in test-proj1 and test-proj2. This could be done by writting project dependence in test-env's build.sbt like this:
val env = (project in file("."))
val core = (project in file("test-core"))
.aggregate(proj1,proj2)
.settings(
run / aggregate := true
)
lazy val coreRef = LocalProject("core")
lazy val proj1 = (project in file("test-proj1")).dependsOn(coreRef)
lazy val proj2 = (project in file("test-proj2")).dependsOn(coreRef)
But the problem is :
When I refer the ActorSystem defined in test-core through test-proj1 and test-proj2.They are not the same ActorSystem.
And I don't want to put all of them into a single project and make proj1 and proj2 as a package.
So How can I refer the same ActorSystem by this project hierarchy ?
two sub project have two main function.
two main function means two application.
two application means two process.
two process means sharing nothing by default.
So The sub project hierarchy talking above can't resolve "the same ActorSystem instance" problem.