From fc2c8ea7fa013a3c449ab0e392c55218a917f970 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 15 Feb 2018 13:57:43 -0800 Subject: Move fatal warnings check from plugin to settings --- src/main/scala/xyz.driver.sbt/FatalWarnings.scala | 31 ----------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/main/scala/xyz.driver.sbt/FatalWarnings.scala (limited to 'src/main/scala/xyz.driver.sbt/FatalWarnings.scala') diff --git a/src/main/scala/xyz.driver.sbt/FatalWarnings.scala b/src/main/scala/xyz.driver.sbt/FatalWarnings.scala deleted file mode 100644 index b7fc585..0000000 --- a/src/main/scala/xyz.driver.sbt/FatalWarnings.scala +++ /dev/null @@ -1,31 +0,0 @@ -package xyz.driver.sbt - -import sbt.{Def, _} -import sbt.Keys._ -import xsbti.compile.CompileAnalysis - -import scala.collection.JavaConverters._ - -object FatalWarnings extends AutoPlugin { - - override def requires = plugins.JvmPlugin - override def trigger = allRequirements - - override def projectSettings: Seq[Def.Setting[_]] = Seq( - compile in Compile := { - val compiled: CompileAnalysis = (compile in Compile).value - val problems = compiled.readSourceInfos().getAllSourceInfos.asScala.flatMap { - case (_, info) => - info.getReportedProblems - } - - val deprecationsOnly = problems.forall { problem => - problem.message().contains("is deprecated") - } - - if (!deprecationsOnly) sys.error("Fatal warnings: some warnings other than deprecations were found.") - compiled - } - ) - -} -- cgit v1.2.3