mirror of https://github.com/sbt/sbt.git
Add "-deprecattion" flag to metabuild
Fixes #2783 Ref #2716 `build.sbt` is treated a Scala source of metabuild, so to enable deprecation flag on build.sbt we set the option here.
This commit is contained in:
parent
0a6c58ad76
commit
00dda2a5f1
|
|
@ -1077,8 +1077,7 @@ object Defaults extends BuildCommon {
|
|||
|
||||
lazy val runnerSettings: Seq[Setting[_]] = Seq(runnerTask)
|
||||
lazy val baseTasks: Seq[Setting[_]] = projectTasks ++ packageBase
|
||||
|
||||
lazy val configSettings: Seq[Setting[_]] = Classpaths.configSettings ++ configTasks ++ configPaths ++ packageConfig ++ Classpaths.compilerPluginConfig
|
||||
lazy val configSettings: Seq[Setting[_]] = Classpaths.configSettings ++ configTasks ++ configPaths ++ packageConfig ++ Classpaths.compilerPluginConfig ++ deprecationSettings
|
||||
|
||||
lazy val compileSettings: Seq[Setting[_]] = configSettings ++ (mainRunMainTask +: mainRunTask +: addBaseSources) ++ Classpaths.addUnmanagedLibrary
|
||||
lazy val testSettings: Seq[Setting[_]] = configSettings ++ testTasks
|
||||
|
|
@ -1093,7 +1092,17 @@ object Defaults extends BuildCommon {
|
|||
baseDirectory := thisProject.value.base,
|
||||
target := baseDirectory.value / "target"
|
||||
)
|
||||
|
||||
// build.sbt is treated a Scala source of metabuild, so to enable deprecation flag on build.sbt we set the option here.
|
||||
lazy val deprecationSettings: Seq[Setting[_]] =
|
||||
inConfig(Compile)(Seq(
|
||||
scalacOptions := {
|
||||
val old = scalacOptions.value
|
||||
val existing = old.toSet
|
||||
val d = "-deprecation"
|
||||
if (sbtPlugin.value && !existing(d)) d :: old.toList
|
||||
else old
|
||||
}
|
||||
))
|
||||
}
|
||||
object Classpaths {
|
||||
import Keys._
|
||||
|
|
|
|||
Loading…
Reference in New Issue