Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6431 from adpi2/fix-6430
Fix unused nowarn in sbt plugins
- Loading branch information
Showing
5 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lazy val root = project.in(file(".")) | ||
.enablePlugins(SbtPlugin) | ||
.settings( | ||
scalaVersion := "2.12.13", | ||
scalacOptions ++= Seq("-Xfatal-warnings", "-Xlint") | ||
) |
22 changes: 22 additions & 0 deletions
22
sbt/src/sbt-test/project/sbt-plugin/src/main/scala/myplugin/MyPlugin.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package myplugin | ||
|
||
import sbt._ | ||
import sbt.Keys._ | ||
|
||
case object MyPlugin extends AutoPlugin { | ||
object autoImport { | ||
val helloWorld = Def.taskKey[String]("log and return hello world") | ||
} | ||
import autoImport._ | ||
override def projectSettings: Seq[Def.Setting[_]] = Seq( | ||
// should not produce a "@nowarn annotation does not suppres any warnings" warning | ||
helloWorld := { | ||
streams.value.log("Hello world") | ||
"Hello world" | ||
}, | ||
Compile / compile := { | ||
helloWorld.value // shoult not produce "a pure expression does nothing" warning | ||
(Compile / compile).value | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
> compile |