-Xfatal-warnings in most subprojects

This commit is contained in:
Eugene Yokota 2018-09-18 11:47:55 -04:00
parent 10d471ad34
commit 3e1dac5161
7 changed files with 16 additions and 10 deletions

View File

@ -193,6 +193,7 @@ val completeProj = (project in file("internal") / "util-complete")
testedBaseSettings,
name := "Completion",
libraryDependencies += jline,
Compile / scalacOptions += "-Ywarn-unused:-explicits",
mimaSettings,
// Parser is used publicly, so we can't break bincompat.
mimaBinaryIssueFilters := Seq(
@ -221,6 +222,7 @@ lazy val testingProj = (project in file("testing"))
baseSettings,
name := "Testing",
libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson.value),
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@ -294,6 +296,7 @@ lazy val runProj = (project in file("run"))
.settings(
testedBaseSettings,
name := "Run",
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@ -398,10 +401,9 @@ lazy val protocolProj = (project in file("protocol"))
.dependsOn(collectionProj)
.settings(
testedBaseSettings,
scalacOptions -= "-Ywarn-unused",
scalacOptions += "-Xlint:-unused",
name := "Protocol",
libraryDependencies ++= Seq(sjsonNewScalaJson.value, ipcSocket),
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@ -443,6 +445,7 @@ lazy val commandProj = (project in file("main-command"))
testedBaseSettings,
name := "Command",
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi),
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@ -546,6 +549,7 @@ lazy val mainProj = (project in file("main"))
testedBaseSettings,
name := "Main",
libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface) ++ log4jDependencies ++ Seq(scalaCacheCaffeine),
Compile / scalacOptions -= "-Xfatal-warnings",
managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",

View File

@ -106,6 +106,7 @@ object Package {
val inputFiles = conf.sources.map(_._1).toSet
val inputs = conf.sources :+: lastModified(inputFiles) :+: manifest :+: HNil
cachedMakeJar(inputs)(() => exists(conf.jar))
()
}
/**

View File

@ -53,7 +53,7 @@ private[sbt] object LibraryManagement {
val finalReport = transform(report)
// Warn of any eviction and compatibility warnings
val ew = EvictionWarning(module, ewo, finalReport, log)
val ew = EvictionWarning(module, ewo, finalReport)
ew.lines.foreach(log.warn(_))
ew.infoAllTheThings.foreach(log.info(_))
CompatibilityWarning.run(compatWarning, module, mavenStyle, log)

View File

@ -43,7 +43,7 @@ abstract class TestBuild {
implicit val tGen = Arbitrary { genTasks(lowerIDGen, MaxDepsGen, MaxTasksGen) }
val seed = rng.Seed.random
final class Keys(val env: Env, val scopes: Seq[Scope]) {
class Keys(val env: Env, val scopes: Seq[Scope]) {
override def toString = env + "\n" + scopes.mkString("Scopes:\n\t", "\n\t", "")
lazy val delegated = scopes map env.delegates
}
@ -119,7 +119,7 @@ abstract class TestBuild {
(taskAxes, zero.toSet, single.toSet, multi.toSet)
}
}
final case class Env(builds: Vector[Build], tasks: Vector[Taskk]) {
case class Env(builds: Vector[Build], tasks: Vector[Taskk]) {
override def toString =
"Env:\n " + " Tasks:\n " + tasks.mkString("\n ") + "\n" + builds.mkString("\n ")
val root = builds.head
@ -159,7 +159,7 @@ abstract class TestBuild {
}
def getKey: Taskk => AttributeKey[_] = _.key
def toConfigKey: Configuration => ConfigKey = c => ConfigKey(c.name)
final case class Build(uri: URI, projects: Seq[Proj]) {
case class Build(uri: URI, projects: Seq[Proj]) {
override def toString = "Build " + uri.toString + " :\n " + projects.mkString("\n ")
val allProjects = projects map { p =>
(ProjectRef(uri, p.id), p)
@ -167,7 +167,7 @@ abstract class TestBuild {
val root = projects.head
val projectMap = mapBy(projects)(_.id)
}
final case class Proj(
case class Proj(
id: String,
delegates: Seq[ProjectRef],
configurations: Seq[Configuration]
@ -178,7 +178,7 @@ abstract class TestBuild {
val confMap = mapBy(configurations)(_.name)
}
final case class Taskk(key: AttributeKey[String], delegates: Seq[Taskk]) {
case class Taskk(key: AttributeKey[String], delegates: Seq[Taskk]) {
override def toString =
key.label + " (delegates: " + delegates.map(_.key.label).mkString(", ") + ")"
}

View File

@ -1,7 +1,7 @@
scalaVersion := "2.12.6"
scalacOptions ++= Seq("-feature", "-language:postfixOps")
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.7")
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.8")
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.8.0")

View File

@ -118,7 +118,7 @@ object RunFromSourceMain {
def globalLock = noGlobalLock
def bootDirectory = RunFromSourceMain.bootDirectory
def ivyHome = file(sys.props("user.home")) / ".ivy2"
final case class PredefRepo(id: Predefined) extends PredefinedRepository
case class PredefRepo(id: Predefined) extends PredefinedRepository
import Predefined._
def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))
def appRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))

View File

@ -8,3 +8,4 @@
package sbt
// ScriptedPlugin has moved to main.
private[sbt] object ScriptedPluginNote