sbt - 如何在sbt中获取 "re-run with -deprecation for details"?

标签 sbt

当我编译 Scala 代码时,通过运行 sbtcompileSBT说:

$ sbt compile
...
[warn] there were 5 deprecation warnings; re-run with -deprecation for details
...

我该怎么做? (来自 SBT 内部?)

最佳答案

sbt 外壳

在 sbt shell 中(如果您不想更改 build.sbt ):

$ sbt
> set ThisBuild/scalacOptions ++= Seq("-unchecked", "-deprecation")
> compile
> exit

由于 in ThisBuild , set还将设置应用于所有子项目。

命令行

您还可以在命令行上将上述命令作为单个命令运行。

sbt '; set ThisBuild/scalacOptions ++= Seq("-unchecked", "-deprecation") ; compile' 

诀窍是使用; (分号)分隔命令和 ' (勾选)包括所有 ; -分隔的命令作为 sbt 的单个参数。

sbt <1.x

而不是 ThisBuild/scalacOptions使用scalacOptions in ThisBuild

关于sbt - 如何在sbt中获取 "re-run with -deprecation for details"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9578521/

相关文章:

testing - 如何在不从命令行测试的情况下运行 sbt 汇编命令?

scala - 如何让 sbt-web 在 Build.scala 中工作?

scala - Heroku Slug 大小为 222 MB/Play Framework 2.1/

scala - 如何在Play 2.3的build.sbt中定义routeImport?

scala - scala 如何支持这种 sbt DSL 语法?

intellij-idea - 在 IntelliJ IDEA 中使用 Play 调试 SBT 项目

scala - 如何在 IntelliJ 13 中调试 Scala SBT 项目?

scala - sbt native 打包器和应用程序可写目录

scala - SBT 在编译期间抛出 StackOverflowError

scala - 如何为 sbt 原生打包器的 DockerPlugin 设置基础镜像?