Let's create folder named hello-world-sbt
, and add the following project structure:
For build.properties
, you need to have the following content:
build.properties sbt.version=0.13.11
For hello_world.scala
, we will use the following code:
hello_world.scala object SbtScalaMainApp extends App { println("Hello world SBT / Scala App ") }
For now we will use an SBT DSL. However, since SBT is written Scala, we can use the build.scala
format if we wish. This is handy in some cases, because we can use any kind of Scala code in order to make the build more dynamic and to reuse code and tasks.
We will set some predefined variables, however, you can create your own variables, which can be used to avoid duplicate code. Finally, let's see the build.sbt
file content as follows:
build.scala name := "hello-world-sbt" version := "1.0" scalaVersion := "2.11...