mirror of https://github.com/sbt/sbt.git
Merge pull request #8221 from eed3si9n/wip/nowarn
This commit is contained in:
commit
69adcb80de
|
|
@ -1002,6 +1002,13 @@ object Defaults extends BuildCommon {
|
|||
)
|
||||
else Def.uncached(old)
|
||||
},
|
||||
scalacOptions := {
|
||||
val old = scalacOptions.value
|
||||
if sbtPlugin.value && VersionNumber(scalaVersion.value)
|
||||
.matchesSemVer(SemanticSelector("=2.12"))
|
||||
then old ++ Seq("-Wconf:cat=unused-nowarn:s", "-Xsource:3")
|
||||
else old
|
||||
},
|
||||
persistJarClasspath :== true,
|
||||
classpathEntryDefinesClassVF := Def.uncached {
|
||||
val cache =
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
organization := "com.example"
|
||||
version := "0.1.0-SNAPSHOT"
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.aggregate(plugin.projectRefs*)
|
||||
|
||||
lazy val plugin = (projectMatrix in file("plugin"))
|
||||
.enablePlugins(SbtPlugin)
|
||||
.settings(
|
||||
name := "example-plugin",
|
||||
scalacOptions ++= {
|
||||
if (scalaBinaryVersion.value == "2.12")
|
||||
Seq("-Xlint", "-Werror")
|
||||
else Seq("-Werror")
|
||||
},
|
||||
(pluginCrossBuild / sbtVersion) := {
|
||||
scalaBinaryVersion.value match
|
||||
case "2.12" => "1.5.8"
|
||||
case _ => "2.0.0-RC3"
|
||||
},
|
||||
)
|
||||
.jvmPlatform(scalaVersions = Seq("3.7.2", "2.12.20"))
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package example
|
||||
|
||||
import sbt._
|
||||
// import Keys.*
|
||||
|
||||
object APlugin extends AutoPlugin {
|
||||
object autoImport {
|
||||
val a = taskKey[Int]("")
|
||||
}
|
||||
|
||||
import autoImport._
|
||||
|
||||
override def projectSettings = Seq(
|
||||
a := 2
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
> projects
|
||||
> compile
|
||||
Loading…
Reference in New Issue