Helix112
Helix112

Reputation: 306

project folder in sbt

I understand that in an sbt project, sbt generates a folder called project containing build.properties and plugins.sbt. Now if I have one project that has multi subprojects, should I have only one folder called project in the root project or different folders named project foreach subproject?

Upvotes: 0

Views: 482

Answers (1)

Tomer Shetah
Tomer Shetah

Reputation: 8539

You should have only one project folder. You can read about it at Multi-project builds in sbt documentation.

For example, to the following sbt:

name := "new_proj"
version := "0.1"
scalaVersion := "2.13.4"

lazy val root = (project in file("."))
  .aggregate(util, core)

lazy val util = (project in file("util"))

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

You should have the structure:

new_proj
  |- build.sbt
  |- project
    |- build.properties
  |- core
    |- src
      |- main
        |- scala
  |- util
    |- src
      |- main
        |- scala

Upvotes: 2

Related Questions