Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-Project SBT Builds with Play Framework

I'm trying to build a Multi-Project Builds using sbt with a Play Framework project.

|-- core (**many external dependancy**)
|   `-- src
|       `-- main
|           `-- scala
|               `-- com
|                   `-- VeryComplexStuff.scala
|-- playWebsite
|   `-- [...]
|
`-- project
    |-- Build.scala
    |-- assembly.sbt
    |-- build.properties
    |-- plugins.sbt
    `-- sbt-updates.sbt

How can the project "playWebsite" dependOn "core" ?
Of course I try to simplify, in reality I have many project who depend on core.

Obviously this is a very common problem but I can't find any solution. Is it maybe because I'm not going in the right direction ?
Maybe core should be a "standalone" project with it own Build.scala ?


https://www.playframework.com/documentation/2.3.5/SBTSubProjects
It doesn't look to fit me. I don't want a sub-project, I want to depend on an "higher lever" project.

https://github.com/kifi/multiproject
I don't want to merge multiple play project

EDIT:

Maybe this is the way to go ? Need advice on project layout for Play 2.2 submodule with other modules as dependencies
like image 615
Martin Magakian Avatar asked Oct 31 '22 16:10

Martin Magakian


1 Answers

in your main build (project/Build.scala or build.sbt) define:

lazy val core = project in file("core") settings(...) 

lazy val play = project in file("playWebsite") settings(...) dependsOn(core)

that's about it...

like image 186
gilad hoch Avatar answered Dec 28 '22 23:12

gilad hoch