-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, testedBaseSettings,
name := "Completion", name := "Completion",
libraryDependencies += jline, libraryDependencies += jline,
Compile / scalacOptions += "-Ywarn-unused:-explicits",
mimaSettings, mimaSettings,
// Parser is used publicly, so we can't break bincompat. // Parser is used publicly, so we can't break bincompat.
mimaBinaryIssueFilters := Seq( mimaBinaryIssueFilters := Seq(
@ -221,6 +222,7 @@ lazy val testingProj = (project in file("testing"))
baseSettings, baseSettings,
name := "Testing", name := "Testing",
libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson.value), libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson.value),
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := 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( .settings(
testedBaseSettings, testedBaseSettings,
name := "Run", name := "Run",
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := 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) .dependsOn(collectionProj)
.settings( .settings(
testedBaseSettings, testedBaseSettings,
scalacOptions -= "-Ywarn-unused",
scalacOptions += "-Xlint:-unused",
name := "Protocol", name := "Protocol",
libraryDependencies ++= Seq(sjsonNewScalaJson.value, ipcSocket), libraryDependencies ++= Seq(sjsonNewScalaJson.value, ipcSocket),
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := 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, testedBaseSettings,
name := "Command", name := "Command",
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi), libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi),
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := 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, testedBaseSettings,
name := "Main", name := "Main",
libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface) ++ log4jDependencies ++ Seq(scalaCacheCaffeine), libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface) ++ log4jDependencies ++ Seq(scalaCacheCaffeine),
Compile / scalacOptions -= "-Xfatal-warnings",
managedSourceDirectories in Compile += managedSourceDirectories in Compile +=
baseDirectory.value / "src" / "main" / "contraband-scala", baseDirectory.value / "src" / "main" / "contraband-scala",
sourceManaged in (Compile, generateContrabands) := 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 inputFiles = conf.sources.map(_._1).toSet
val inputs = conf.sources :+: lastModified(inputFiles) :+: manifest :+: HNil val inputs = conf.sources :+: lastModified(inputFiles) :+: manifest :+: HNil
cachedMakeJar(inputs)(() => exists(conf.jar)) cachedMakeJar(inputs)(() => exists(conf.jar))
()
} }
/** /**

View File

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

View File

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

View File

@ -1,7 +1,7 @@
scalaVersion := "2.12.6" scalaVersion := "2.12.6"
scalacOptions ++= Seq("-feature", "-language:postfixOps") 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("org.scala-sbt" % "sbt-contraband" % "0.4.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.8.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.8.0")

View File

@ -118,7 +118,7 @@ object RunFromSourceMain {
def globalLock = noGlobalLock def globalLock = noGlobalLock
def bootDirectory = RunFromSourceMain.bootDirectory def bootDirectory = RunFromSourceMain.bootDirectory
def ivyHome = file(sys.props("user.home")) / ".ivy2" 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._ import Predefined._
def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral)) def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))
def appRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral)) def appRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))

View File

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