mirror of https://github.com/sbt/sbt.git
Add a discussion of the blank lines in .sbt files; realized everyone keeps mentioning this but "getting started" barely did
parent
00504bb3f1
commit
3ae924f4e9
|
|
@ -111,6 +111,22 @@ If you use the wrong value type, the build definition will not compile:
|
|||
```scala
|
||||
name := 42 // will not compile
|
||||
```
|
||||
### Settings are separated by blank lines
|
||||
|
||||
You can't write a `build.sbt` like this:
|
||||
|
||||
```scala
|
||||
// will NOT work, no blank lines
|
||||
name := "hello"
|
||||
version := "1.0"
|
||||
scalaVersion := "2.9.1"
|
||||
```
|
||||
|
||||
sbt needs some kind of delimiter to tell where one expression stops and the next begins.
|
||||
|
||||
`.sbt` files contain a list of Scala expressions, not a single Scala program. These expressions have to be split up and passed to the compiler individually.
|
||||
|
||||
If you want a single Scala program, use [[.scala files|Getting Started Full Def]] rather than `.sbt` files; `.sbt` files are optional. [[Later on|Getting Started Full Def]] this guide explains how to use `.scala` files. (Preview: the same settings expressions found in a `.sbt` file can always be listed in a `Seq[Setting]` in a `.scala` file instead.)
|
||||
|
||||
## Keys are defined in the Keys object
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue