Skip to content

Commit

Permalink
Fix unused nowarn in sbt plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
adpi2 committed Apr 6, 2021
1 parent 7c266e8 commit 3da6160
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion main/src/main/scala/sbt/plugins/SbtPlugin.scala
Expand Up @@ -10,11 +10,22 @@ package plugins

import Keys._
import Def.Setting
import sbt.SlashSyntax0._
import sbt.librarymanagement.Configurations.Compile
import sbt.librarymanagement.{ SemanticSelector, VersionNumber }

object SbtPlugin extends AutoPlugin {
override def requires = ScriptedPlugin

override lazy val projectSettings: Seq[Setting[_]] = Seq(
sbtPlugin := true
sbtPlugin := true,
Compile / scalacOptions ++= {
// silence unused @nowarns in 2.12 because of https://github.com/sbt/sbt/issues/6398
// the option is only available since 2.12.13
if (VersionNumber(scalaVersion.value).matchesSemVer(SemanticSelector("=2.12 && >=2.12.13")))
Some("-Wconf:cat=unused-nowarn:s")
else
None
}
)
}

0 comments on commit 3da6160

Please sign in to comment.