How to create scala project with sbt
Creating package structure
Command to create package structure:
sbt new scala/scalatest-example.g8
Then you have to cd
into the directory and run tests by
sbt test
This will run the test suite CubeCalculatorTest
with a single test called CubeCalculator.cube
.
Then you can transform the code to your need.
sbt commands
Compile
sbt compile
Run
sbt run
Package
sbt package
The jar is located in target/scala-X.XX/
.
Assembly
This will create a fat JAR of your project with all of its dependencies (https://github.com/sbt/sbt-assembly).
In project/plugins.sbt
add
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
Setting up sbt version
In project/build.properties
change line into, for example,
sbt.version= 1.4.4
Setting up scala version
In build.sbt
set up
scalaVersion := "2.13.4"
Links
Updated: 2020-12-10