The project I linked to demonstrates a complicated SBT build.sbt file for a multi-project build.
As a quick note to self, here’s an example of how to set
scalacOptions in an SBT build.sbt file:
scalacOptions ++= Seq( "-Xfatal-warnings", "-deprecation", "-feature", "-unchecked", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-language:postfixOps" )
scalacOptions lets you set Scala compiler options in your SBT project build.
libraryDependencies ++= Seq( guice, "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.2" % Test, jdbc, "mysql" % "mysql-connector-java" % "5.1.46", "com.typesafe.play" %% "anorm" % "2.5.3" )
If you haven’t been through it yet, this what the process of creating a new project with the Play Framework version 2.6 looks like:
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.16, “Using Build.scala Instead of build.sbt.”
In an SBT project, you want to use the project/Build.scala file instead of build.sbt to define your Scala project, or you need some examples of how to use Build.scala to solve build problems that can’t be handled in build.sbt.
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.11, “Telling SBT How to Find a Repository (Working with Resolvers).”
In a Scala SBT project, you want to add a managed dependency to your project from an Ivy repository that SBT doesn’t know about by default.
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.9, “Specifying a Main Class to Run with SBT.”
In a Scala SBT project, you have multiple
main methods in objects in your project, and you want to specify which
main method should be run when you type
sbt run, or specify the
main method that should be invoked when your project is packaged as a JAR file.
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.13, “Setting the SBT Log Level.”
You’re having a problem compiling, running, or packaging your project with SBT, and need to adjust the SBT logging level to debug the problem. (Or, you’re interested in learning about how SBT works.)
Set the SBT logging level in your build.sbt file with this setting: