0

I have multi module sbt project:

├── build.sbt
├── bar
│   ├── build.sbt
│   └── ...
├── foo
│   ├── build.sbt
│   └── ...
└── ...

And 2 versions of build.sbt:

lazy val foo = project in(file("./foo"))
lazy val bar = project in(file("./bar"))

And second version:

lazy val foo = project in(file("./foo"))
lazy val bar = project in(file("./bar"))

lazy val root = Project(id = "root",
  base = file(".")) aggregate(foo, bar)

What are the differences between these versions? Are there any pros in second version?

krynio
  • 2,442
  • 26
  • 30
  • I presume the two versions are just for the top-level build.sbt, and the question can be answered without reference to them. – Chris Murphy Jul 14 '15 at 03:02

1 Answers1

0

With your second version loaded type projects at the sbt command line and you should see that you have three of them. The one with a star at the front is the default project. It will be your root project. Commands that you type will apply to it. As it is an aggregate project the commands will be applying in turn to both foo and bar.

package is a good example command - typing it should produce a jar file that has both the foo and bar classes in it, if that is what you want.

Chris Murphy
  • 6,411
  • 1
  • 24
  • 42