sbt shell
While in sbt shell (if you don’t want to change your build.sbt):
$ sbt
> set ThisBuild/scalacOptions ++= Seq("-unchecked", "-deprecation")
> compile
> exit
Due to in ThisBuild, set applies the settings to all sub-projects, as well.
Command Line
You could also run the above as a single command on command line.
sbt '; set ThisBuild/scalacOptions ++= Seq("-unchecked", "-deprecation") ; compile'
The trick is to use ; (semicolons) to separate commands and ' (ticks) to include all ;-separated commands as a single argument to sbt.
sbt < 1.x
Instead of ThisBuild/scalacOptions use scalacOptions in ThisBuild