I've been working with these docs: https://www.playframework.com/documentation/2.4.x/SBTSubProjects and have split up a large project in a main and a sub module.
Some 7000 compiler errors, lots of caffeine and a whole to of "wow -- wish I knew that before"'s later I have the project working once more with it's new modular layout.
Now I want to create a second sub-module.
Let's call the main module ROOT and we'll can sub-module A ModA and sub-module B ModB.
ROOT will depend upon ModA and ModB
ModA will not depending on anything
ModB will depend upon ModA
Will it be more elegant (read: maintainable) to have ModA and ModB be siblings or is it mode elegant to have a chain of submodules indicating the flow of inheritance?
ROOT -> ModB -> ModA
This will get mess(ier) if (when) we add ModC and ModD etc so I'm hoping we can do this with the sibling's 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'll presume that I can chain the dependsOn
and aggregate
calls.
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 would the dependancy of ModB to ModA be declared? (assuming in build.sbt of ModB)
lazy val moduleA = (project in file("modules/ModA")).enablePlugins(PlayScala)
lazy val ROOT = (project in file("."))
.enablePlugins(PlayScala).dependsOn(ModA).aggregate(ModA)