You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SBT, along with Maven, is a default way to build Scala applications. `build.sbt` is the file that defines how your project is built, but sometimes you'll also see `build.scala` files in specific projects.
10
+
11
+
`build.scala` is the more advanced version of the `build.sbt` file, and often is used for more complicated projects.
12
+
13
+
[Here's an example](https://stackoverflow.com/questions/18000103/what-is-the-difference-between-build-sbt-and-build-scala) of the difference between .sbt and .scala build files:
14
+
15
+
build.sbt
16
+
```
17
+
name := "hello"
18
+
19
+
version := "1.0"
20
+
```
21
+
22
+
build.scala
23
+
```
24
+
import sbt._
25
+
import Keys._
26
+
27
+
object Build extends Build {
28
+
lazy val root = Project(id = "root", base = file(".")).settings(
29
+
name := "hello",
30
+
version := "1.0"
31
+
)
32
+
}
33
+
```
34
+
35
+
36
+
37
+
From [the official docs](https://www.scala-sbt.org/1.x/docs/Organizing-Build.html#When+to+use++files)
38
+
39
+
```
40
+
The recommended approach is to define most settings in a multi-project build.sbt file, and using project/*.scala files for task implementations or to share values, such as keys. The use of .scala files also depends on how comfortable you or your team are with Scala.
41
+
```
42
+
43
+
Here's [another great doc on sbt vs Scala files.](https://alvinalexander.com/scala/sbt-how-to-use-build.scala-instead-of-build.sbt/)
0 commit comments