Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions io/src/main/scala/sbt/internal/io/ErrorHandling.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package sbt.internal.io

import java.io.IOException
import scala.annotation.nowarn

private[sbt] object ErrorHandling {
def translate[T](msg: => String)(f: => T) =
Expand All @@ -22,6 +23,7 @@ private[sbt] object ErrorHandling {
case e: Exception => throw new TranslatedException(msg + e.toString, e)
}

@nowarn("msg=ThreadDeath")
def wideConvert[T](f: => T): Either[Throwable, T] =
try {
Right(f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import sbt.nio.file.{ AnyPath, FileAttributes, FileTreeView, Glob, RecursiveGlob
import sbt.nio.file.Glob.GlobOps

import scala.annotation.tailrec
import scala.annotation.nowarn
import scala.jdk.CollectionConverters._
import scala.collection.{ immutable, mutable }
import scala.concurrent.duration._
Expand Down Expand Up @@ -298,6 +299,7 @@ private[sbt] object WatchState {
init
}

@nowarn("msg=WatchState")
def empty(globs: Seq[Glob]): WatchState = {
val service = new WatchService {
override def init(): Unit = {}
Expand Down
2 changes: 1 addition & 1 deletion io/src/test/scala/sbt/io/IOSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,6 @@ class IOSpec extends AnyFunSuite {
}

def normalizeForWindows(s: String): String = {
s.replaceAllLiterally("""\""", "/")
s.replace("""\""", "/")
}
}
28 changes: 12 additions & 16 deletions project/HouseRulesPluglin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@ object HouseRulesPlugin extends AutoPlugin {
scalacOptions ++= Seq("-encoding", "utf8"),
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked"),
scalacOptions += "-language:implicitConversions",
scalacOptions ++= "-Werror"
.ifScala(v => {
sys.props.get("sbt.build.fatal") match {
case Some(_) => java.lang.Boolean.getBoolean("sbt.build.fatal")
case _ => v == 12
}
})
.value
.toList,
scalacOptions ++= Seq(
"-Wconf:msg=Compiler synthesis of Manifest and OptManifest is deprecated:silent",
"-Wconf:msg=type Traversable in package scala:silent",
),
scalacOptions ++= {
sys.props.get("sbt.build.fatal") match {
case Some("false") =>
Nil
case _ =>
Seq("-Werror")
}
}
)

private def scalaPartV = Def setting (CrossVersion partialVersion scalaVersion.value)

private implicit final class AnyWithIfScala[A](val __x: A) {
def ifScala(p: Long => Boolean) =
Def setting (scalaPartV.value collect { case (2, y) if p(y) => __x })
}
}