I worked with these documents: https://www.playframework.com/documentation/2.4.x/SBTSubProjects and shared a large project in the main and additional module.
Some 7000 compiler errors, a lot of caffeine and the whole βwow - I want me to know this beforeβ project later with a new modular layout.
Now I want to create a second submodule.
Let us call the main module ROOT, and we can submodule A ModA and submodule B ModB.
ROOT will depend on ModA and ModB
ModA will not depend on anything
ModB will depend on ModA
Would it be more elegant (read: maintenanceable) for ModA and ModB to be siblings, or would it be elegant to have a chain of submodules indicating the flow of inheritance?
ROOT β ModB β ModA
It will be a mess (ier) if (when) we add ModC and ModD, etc., so I hope that we can do this using the sibling model.
Most of the magic appears here, I believe:
lazy val moduleA = (project in file("modules/ModA")).enablePlugins(PlayScala) lazy val ROOT = (project in file(".")) .enablePlugins(PlayScala).dependsOn(ModA).aggregate(ModA)
I assume that I can bind the calls to dependsOn and aggregate .
lazy val moduleA = (project in file("modules/ModA")).enablePlugins(PlayScala) lazy val moduleB = (project in file("modules/ModB")).enablePlugins(PlayScala) lazy val ROOT = (project in file(".")) .enablePlugins(PlayScala).dependsOn(ModA) .aggregate(ModA).dependsOn(ModB).aggregate(ModB)
Using the siblings model, how will the dependence of ModB on ModA be announced? (assuming in build.sbt ModB)
lazy val moduleA = (project in file("modules/ModA")).enablePlugins(PlayScala) lazy val ROOT = (project in file(".")) .enablePlugins(PlayScala).dependsOn(ModA).aggregate(ModA)