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:
++= Seq(
scalacOptions "-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:
++= Seq("-unchecked", "-deprecation") set scalacOptions in ThisBuild
You can then kick off a new compilation with:
;clean;compile
to see any deprecation warnings. And that’s all there is to it. :)