What's the difference between project/build.sbt
and project/BuildApp.scala
? Can I create any of them interchangeably?
Asked
Active
Viewed 265 times
5

Jacek Laskowski
- 72,696
- 27
- 242
- 420

Incerteza
- 32,326
- 47
- 154
- 261
1 Answers
6
First, equivalent to project/BuildApp.scala
is build.sbt
, not project/build.sbt
. They are different in what they allow: .scala
lets you do things .sbt
doesn't, and they can be used together.

Alexey Romanov
- 167,066
- 35
- 309
- 487
-
In that case, why to use .sbt at all? – Incerteza Dec 29 '13 at 09:54
-
Because it can be simpler than equivalent .scala. – Alexey Romanov Dec 29 '13 at 10:04
-
So one can use `project/BuildApp.scala` without using `build.sbt` at all but not vise versa, correct? – Incerteza Dec 29 '13 at 10:08
-
No, you can use `build.sbt` by itself. You just won't be able to do some things which aren't needed for simple projects. From the docs: "The recommended approach is to define most configuration in .sbt files, using .scala files for task implementations or to share values, such as keys, across .sbt files." – Alexey Romanov Dec 29 '13 at 10:12
-
once again `You just won't be able to do some things which aren't needed for simple projects` - So one can use project/BuildApp.scala without using build.sbt at all but not vise versa, correct? – Incerteza Dec 29 '13 at 10:22
-
Once again: you can do vice versa in most cases. – Alexey Romanov Dec 29 '13 at 10:28
-
If .scala lets you do things .sbt doesn't, why can't I use .scala always and not use .sbt at all? I don't care about simplicity. – Incerteza Dec 29 '13 at 10:31
-
"why can't I use .scala always and not use .sbt at all" You can. – Alexey Romanov Dec 29 '13 at 10:33
-
Ok, that was my second comment. – Incerteza Dec 29 '13 at 10:44
-
I was responding to "but not vice versa". – Alexey Romanov Dec 29 '13 at 16:23
-
You were responding "no". – Incerteza Dec 29 '13 at 18:42
-
2Perhaps you should just read the docs: http://www.scala-sbt.org/0.13.1/docs/Getting-Started/Basic-Def.html – James Roper Dec 30 '13 at 12:37