Re-run Compilation with Deprecations Turned on from within SBT
Often while compiling some Scala project from with SBT, I’d see the following error:
re-run with -deprecation for details
And then I would have to go and update my build.sbt file with with following:
scalacOptions ++= Seq(
"-deprecation",
//other options
)
and then relaunch SBT and perform the compilation again. That’s a little painful.
I stumbled across this incantation to achieve the same result from right within SBT:
set scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation")
You can then kick off a new compilation with:
;clean;compile
to see any deprecation warnings. And that’s all there is to it. :)