Install and Use Simple Build Tool
1. Installing sbt
If I have MacPorts, I will use this command to do so.
>sudo port selfupdate
Update the MacPorts tool itself to update.
>sudo port install sbt
2. Create a simple project to validate my installation.
>mkdir hello
>cd hello
>echo 'object Hi { def main(args: Array[String]) = println("Hi!") }' > hw.scala
>sbt
sbt>run
…Hi!…
That is how I run the simple project. And I can also run it like this.
>sbt run
The command will check
Sources in the base directory
Sources in src/main/scala or src/main/java
Tests in src/test/scala or src/test/java
Data files in src/main/resources or src/test/resources
jars in lib
We can also have the build definition files.
build.sbt
project/
Build.scala
references:
https://github.com/harrah/xsbt
http://www.scala-sbt.org/release/docs/Getting-Started/index.html
1. Installing sbt
If I have MacPorts, I will use this command to do so.
>sudo port selfupdate
Update the MacPorts tool itself to update.
>sudo port install sbt
2. Create a simple project to validate my installation.
>mkdir hello
>cd hello
>echo 'object Hi { def main(args: Array[String]) = println("Hi!") }' > hw.scala
>sbt
sbt>run
…Hi!…
That is how I run the simple project. And I can also run it like this.
>sbt run
The command will check
Sources in the base directory
Sources in src/main/scala or src/main/java
Tests in src/test/scala or src/test/java
Data files in src/main/resources or src/test/resources
jars in lib
We can also have the build definition files.
build.sbt
project/
Build.scala
references:
https://github.com/harrah/xsbt
http://www.scala-sbt.org/release/docs/Getting-Started/index.html