Merge branch 'develop' into state-transform

This commit is contained in:
Ethan Atkins 2019-12-02 08:03:46 -08:00 committed by GitHub
commit 1a7d6a84f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 116 additions and 83 deletions

View File

@ -1,4 +1,4 @@
version = 2.0.0 version = 2.2.1
maxColumn = 100 maxColumn = 100
project.git = true project.git = true
project.excludeFilters = [ "\\Wsbt-test\\W", "\\Winput_sources\\W", "\\Wcontraband-scala\\W" ] project.excludeFilters = [ "\\Wsbt-test\\W", "\\Winput_sources\\W", "\\Wcontraband-scala\\W" ]

View File

@ -8,7 +8,7 @@ env:
# WHITESOURCE_PASSWORD= # WHITESOURCE_PASSWORD=
- secure: d3bu2KNwsVHwfhbGgO+gmRfDKBJhfICdCJFGWKf2w3Gv86AJZX9nuTYRxz0KtdvEHO5Xw8WTBZLPb2thSJqhw9OCm4J8TBAVqCP0ruUj4+aqBUFy4bVexQ6WKE6nWHs4JPzPk8c6uC1LG3hMuzlC8RGETXtL/n81Ef1u7NjyXjs= - secure: d3bu2KNwsVHwfhbGgO+gmRfDKBJhfICdCJFGWKf2w3Gv86AJZX9nuTYRxz0KtdvEHO5Xw8WTBZLPb2thSJqhw9OCm4J8TBAVqCP0ruUj4+aqBUFy4bVexQ6WKE6nWHs4JPzPk8c6uC1LG3hMuzlC8RGETXtL/n81Ef1u7NjyXjs=
matrix: matrix:
- SBT_CMD=";mimaReportBinaryIssues ;scalafmtCheckAll ;headerCheck ;test:headerCheck ;whitesourceOnPush ;test:compile; publishLocal ;mainSettingsProj/test ;safeUnitTests ;otherUnitTests; doc" - SBT_CMD="mimaReportBinaryIssues ;scalafmtCheckAll ; scalafmtSbtCheck; headerCheck ;test:headerCheck ;whitesourceOnPush ;test:compile; publishLocal ;mainSettingsProj/test ;safeUnitTests ;otherUnitTests; doc"
- SBT_CMD="scripted actions/* apiinfo/* compiler-project/* ivy-deps-management/* reporter/* tests/* watch/* classloader-cache/* package/*" - SBT_CMD="scripted actions/* apiinfo/* compiler-project/* ivy-deps-management/* reporter/* tests/* watch/* classloader-cache/* package/*"
- SBT_CMD="scripted dependency-management/* plugins/* project-load/* java/* run/* nio/*" - SBT_CMD="scripted dependency-management/* plugins/* project-load/* java/* run/* nio/*"
- SBT_CMD="repoOverrideTest:scripted dependency-management/*; scripted source-dependencies/* project/*" - SBT_CMD="repoOverrideTest:scripted dependency-management/*; scripted source-dependencies/* project/*"

View File

@ -67,7 +67,10 @@ def commonSettings: Seq[Setting[_]] = Def.settings(
resolvers += Resolver.typesafeIvyRepo("releases").withName("typesafe-sbt-build-ivy-releases"), resolvers += Resolver.typesafeIvyRepo("releases").withName("typesafe-sbt-build-ivy-releases"),
resolvers += Resolver.sonatypeRepo("snapshots"), resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += "bintray-sbt-maven-releases" at "https://dl.bintray.com/sbt/maven-releases/", resolvers += "bintray-sbt-maven-releases" at "https://dl.bintray.com/sbt/maven-releases/",
resolvers += Resolver.url("bintray-scala-hedgehog", url("https://dl.bintray.com/hedgehogqa/scala-hedgehog"))(Resolver.ivyStylePatterns), resolvers += Resolver.url(
"bintray-scala-hedgehog",
url("https://dl.bintray.com/hedgehogqa/scala-hedgehog")
)(Resolver.ivyStylePatterns),
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.4" cross CrossVersion.binary), addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.4" cross CrossVersion.binary),
testFrameworks += TestFramework("hedgehog.sbt.Framework"), testFrameworks += TestFramework("hedgehog.sbt.Framework"),
concurrentRestrictions in Global += Util.testExclusiveRestriction, concurrentRestrictions in Global += Util.testExclusiveRestriction,
@ -242,7 +245,6 @@ val collectionProj = (project in file("internal") / "util-collection")
// it's now abstract in KList and defined in both KCons & KNil. // it's now abstract in KList and defined in both KCons & KNil.
exclude[FinalMethodProblem]("sbt.internal.util.KNil.foldr"), exclude[FinalMethodProblem]("sbt.internal.util.KNil.foldr"),
exclude[DirectAbstractMethodProblem]("sbt.internal.util.KList.foldr"), exclude[DirectAbstractMethodProblem]("sbt.internal.util.KList.foldr"),
exclude[IncompatibleSignatureProblem]("sbt.internal.util.Init*.*"), exclude[IncompatibleSignatureProblem]("sbt.internal.util.Init*.*"),
exclude[IncompatibleSignatureProblem]("sbt.internal.util.Settings0.*"), exclude[IncompatibleSignatureProblem]("sbt.internal.util.Settings0.*"),
exclude[IncompatibleSignatureProblem]("sbt.internal.util.EvaluateSettings#INode.*"), exclude[IncompatibleSignatureProblem]("sbt.internal.util.EvaluateSettings#INode.*"),
@ -251,7 +253,9 @@ val collectionProj = (project in file("internal") / "util-collection")
exclude[IncompatibleSignatureProblem]("sbt.internal.util.Settings.*"), exclude[IncompatibleSignatureProblem]("sbt.internal.util.Settings.*"),
exclude[IncompatibleSignatureProblem]("sbt.internal.util.EvaluateSettings#MixedNode.*"), exclude[IncompatibleSignatureProblem]("sbt.internal.util.EvaluateSettings#MixedNode.*"),
exclude[IncompatibleSignatureProblem]("sbt.internal.util.EvaluateSettings#BindNode.this"), exclude[IncompatibleSignatureProblem]("sbt.internal.util.EvaluateSettings#BindNode.this"),
exclude[IncompatibleSignatureProblem]("sbt.internal.util.EvaluateSettings#BindNode.dependsOn"), exclude[IncompatibleSignatureProblem](
"sbt.internal.util.EvaluateSettings#BindNode.dependsOn"
),
exclude[IncompatibleSignatureProblem]("sbt.internal.util.Types.some") exclude[IncompatibleSignatureProblem]("sbt.internal.util.Types.some")
), ),
) )
@ -736,7 +740,6 @@ lazy val mainProj = (project in file("main"))
exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"), exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"),
// internal // internal
exclude[IncompatibleMethTypeProblem]("sbt.internal.server.LanguageServerReporter.*"), exclude[IncompatibleMethTypeProblem]("sbt.internal.server.LanguageServerReporter.*"),
// Changed signature or removed private[sbt] methods // Changed signature or removed private[sbt] methods
exclude[DirectMissingMethodProblem]("sbt.Classpaths.unmanagedLibs0"), exclude[DirectMissingMethodProblem]("sbt.Classpaths.unmanagedLibs0"),
exclude[DirectMissingMethodProblem]("sbt.Defaults.allTestGroupsTask"), exclude[DirectMissingMethodProblem]("sbt.Defaults.allTestGroupsTask"),
@ -755,11 +758,14 @@ lazy val mainProj = (project in file("main"))
exclude[IncompatibleSignatureProblem]("sbt.plugins.SbtPlugin.*Settings"), exclude[IncompatibleSignatureProblem]("sbt.plugins.SbtPlugin.*Settings"),
// Removed private internal classes // Removed private internal classes
exclude[MissingClassProblem]("sbt.internal.ReverseLookupClassLoaderHolder$BottomClassLoader"), exclude[MissingClassProblem]("sbt.internal.ReverseLookupClassLoaderHolder$BottomClassLoader"),
exclude[MissingClassProblem]("sbt.internal.ReverseLookupClassLoaderHolder$ReverseLookupClassLoader$ResourceLoader"), exclude[MissingClassProblem](
"sbt.internal.ReverseLookupClassLoaderHolder$ReverseLookupClassLoader$ResourceLoader"
),
exclude[MissingClassProblem]("sbt.internal.ReverseLookupClassLoaderHolder$ClassLoadingLock"), exclude[MissingClassProblem]("sbt.internal.ReverseLookupClassLoaderHolder$ClassLoadingLock"),
exclude[MissingClassProblem]("sbt.internal.ReverseLookupClassLoaderHolder$ReverseLookupClassLoader"), exclude[MissingClassProblem](
"sbt.internal.ReverseLookupClassLoaderHolder$ReverseLookupClassLoader"
),
exclude[MissingClassProblem]("sbt.internal.LayeredClassLoaderImpl"), exclude[MissingClassProblem]("sbt.internal.LayeredClassLoaderImpl"),
// false positives // false positives
exclude[DirectMissingMethodProblem]("sbt.plugins.IvyPlugin.requires"), exclude[DirectMissingMethodProblem]("sbt.plugins.IvyPlugin.requires"),
exclude[DirectMissingMethodProblem]("sbt.plugins.JUnitXmlReportPlugin.requires"), exclude[DirectMissingMethodProblem]("sbt.plugins.JUnitXmlReportPlugin.requires"),
@ -769,17 +775,19 @@ lazy val mainProj = (project in file("main"))
exclude[DirectMissingMethodProblem]("sbt.ResolvedClasspathDependency.apply"), exclude[DirectMissingMethodProblem]("sbt.ResolvedClasspathDependency.apply"),
exclude[DirectMissingMethodProblem]("sbt.ClasspathDependency.apply"), exclude[DirectMissingMethodProblem]("sbt.ClasspathDependency.apply"),
exclude[IncompatibleSignatureProblem]("sbt.plugins.SemanticdbPlugin.globalSettings"), exclude[IncompatibleSignatureProblem]("sbt.plugins.SemanticdbPlugin.globalSettings"),
// File -> Source // File -> Source
exclude[DirectMissingMethodProblem]("sbt.Defaults.cleanFilesTask"), exclude[DirectMissingMethodProblem]("sbt.Defaults.cleanFilesTask"),
exclude[IncompatibleSignatureProblem]("sbt.Defaults.resourceConfigPaths"), exclude[IncompatibleSignatureProblem]("sbt.Defaults.resourceConfigPaths"),
exclude[IncompatibleSignatureProblem]("sbt.Defaults.sourceConfigPaths"), exclude[IncompatibleSignatureProblem]("sbt.Defaults.sourceConfigPaths"),
exclude[IncompatibleSignatureProblem]("sbt.Defaults.configPaths"), exclude[IncompatibleSignatureProblem]("sbt.Defaults.configPaths"),
exclude[IncompatibleSignatureProblem]("sbt.Defaults.paths"), exclude[IncompatibleSignatureProblem]("sbt.Defaults.paths"),
exclude[IncompatibleSignatureProblem]("sbt.Keys.csrPublications"), exclude[IncompatibleSignatureProblem]("sbt.Keys.csrPublications"),
exclude[IncompatibleSignatureProblem]("sbt.coursierint.CoursierArtifactsTasks.coursierPublicationsTask"), exclude[IncompatibleSignatureProblem](
exclude[IncompatibleSignatureProblem]("sbt.coursierint.CoursierArtifactsTasks.coursierPublicationsTask"), "sbt.coursierint.CoursierArtifactsTasks.coursierPublicationsTask"
),
exclude[IncompatibleSignatureProblem](
"sbt.coursierint.CoursierArtifactsTasks.coursierPublicationsTask"
),
exclude[IncompatibleSignatureProblem]("sbt.coursierint.LMCoursier.coursierConfiguration"), exclude[IncompatibleSignatureProblem]("sbt.coursierint.LMCoursier.coursierConfiguration"),
exclude[IncompatibleSignatureProblem]("sbt.coursierint.LMCoursier.publicationsSetting"), exclude[IncompatibleSignatureProblem]("sbt.coursierint.LMCoursier.publicationsSetting"),
exclude[IncompatibleSignatureProblem]("sbt.Project.inThisBuild"), exclude[IncompatibleSignatureProblem]("sbt.Project.inThisBuild"),
@ -790,7 +798,6 @@ lazy val mainProj = (project in file("main"))
exclude[IncompatibleSignatureProblem]("sbt.ProjectExtra.inConfig"), exclude[IncompatibleSignatureProblem]("sbt.ProjectExtra.inConfig"),
exclude[IncompatibleSignatureProblem]("sbt.ProjectExtra.inTask"), exclude[IncompatibleSignatureProblem]("sbt.ProjectExtra.inTask"),
exclude[IncompatibleSignatureProblem]("sbt.ProjectExtra.inScope"), exclude[IncompatibleSignatureProblem]("sbt.ProjectExtra.inScope"),
exclude[MissingTypesProblem]("sbt.internal.Load*"), exclude[MissingTypesProblem]("sbt.internal.Load*"),
exclude[IncompatibleSignatureProblem]("sbt.internal.Load*"), exclude[IncompatibleSignatureProblem]("sbt.internal.Load*"),
) )

View File

@ -495,6 +495,7 @@ object Keys {
val lintUnused = inputKey[Unit]("Check for keys unused by other settings and tasks.") val lintUnused = inputKey[Unit]("Check for keys unused by other settings and tasks.")
val excludeLintKeys = settingKey[Set[Def.KeyedInitialize[_]]]("Keys excluded from lintUnused task") val excludeLintKeys = settingKey[Set[Def.KeyedInitialize[_]]]("Keys excluded from lintUnused task")
val includeLintKeys = settingKey[Set[Def.KeyedInitialize[_]]]("Task keys that are included into lintUnused task") val includeLintKeys = settingKey[Set[Def.KeyedInitialize[_]]]("Task keys that are included into lintUnused task")
val lintUnusedKeysOnLoad = settingKey[Boolean]("Toggles whether or not to check for unused keys during startup")
val stateStreams = AttributeKey[Streams]("stateStreams", "Streams manager, which provides streams for different contexts. Setting this on State will override the default Streams implementation.") val stateStreams = AttributeKey[Streams]("stateStreams", "Streams manager, which provides streams for different contexts. Setting this on State will override the default Streams implementation.")
val resolvedScoped = Def.resolvedScoped val resolvedScoped = Def.resolvedScoped

View File

@ -354,7 +354,8 @@ object Project extends ProjectExtra {
validProjectID(id).foreach(errMsg => sys.error(s"Invalid project ID: $errMsg")) validProjectID(id).foreach(errMsg => sys.error(s"Invalid project ID: $errMsg"))
val plugins = Plugins.empty val plugins = Plugins.empty
val origin = ProjectOrigin.GenericRoot val origin = ProjectOrigin.GenericRoot
new ProjectDef(id, base, aggregate, Nil, Nil, Nil, plugins, Nil, origin) with Project new ProjectDef(id, base, aggregate, Nil, Nil, Nil, plugins, Nil, origin)
with Project
with GeneratedRootProject with GeneratedRootProject
} }

View File

@ -39,6 +39,7 @@ object LintUnused {
ivyConfiguration, ivyConfiguration,
), ),
Keys.lintUnused := lintUnusedTask.evaluated, Keys.lintUnused := lintUnusedTask.evaluated,
Keys.lintUnusedKeysOnLoad := true,
) )
// input task version of the lintUnused // input task version of the lintUnused
@ -59,8 +60,10 @@ object LintUnused {
val extracted = Project.extract(s) val extracted = Project.extract(s)
val includeKeys = extracted.get(includeLintKeys in Global) map { _.scopedKey.key.label } val includeKeys = extracted.get(includeLintKeys in Global) map { _.scopedKey.key.label }
val excludeKeys = extracted.get(excludeLintKeys in Global) map { _.scopedKey.key.label } val excludeKeys = extracted.get(excludeLintKeys in Global) map { _.scopedKey.key.label }
if (extracted.get(lintUnusedKeysOnLoad in Global)) {
val result = lintUnused(s, includeKeys, excludeKeys) val result = lintUnused(s, includeKeys, excludeKeys)
lintResultLines(result) foreach { log.warn(_) } lintResultLines(result) foreach { log.warn(_) }
}
s s
} }
@ -70,6 +73,8 @@ object LintUnused {
import scala.collection.mutable.ListBuffer import scala.collection.mutable.ListBuffer
val buffer = ListBuffer.empty[String] val buffer = ListBuffer.empty[String]
if (result.isEmpty) Vector.empty
else {
val size = result.size val size = result.size
if (size == 1) buffer.append("there's a key that's not used by any other settings/tasks:") if (size == 1) buffer.append("there's a key that's not used by any other settings/tasks:")
else buffer.append(s"there are $size keys that are not used by any other settings/tasks:") else buffer.append(s"there are $size keys that are not used by any other settings/tasks:")
@ -91,6 +96,7 @@ object LintUnused {
) )
buffer.toVector buffer.toVector
} }
}
def lintUnused( def lintUnused(
state: State, state: State,

View File

@ -148,7 +148,8 @@ private[sbt] object SettingsGraph {
case _ => Some(Left(s)) case _ => Some(Left(s))
} }
case _ => None case _ => None
} else { }
else {
None None
} }
}.toSeq }.toSeq

View File

@ -111,7 +111,8 @@ private[sbt] object Definition {
case h :: _ if h.length < fragment.length => fragment :: Nil case h :: _ if h.length < fragment.length => fragment :: Nil
case h :: _ if h.length == fragment.length => fragment :: z case h :: _ if h.length == fragment.length => fragment :: z
case _ => z case _ => z
} else z }
else z
} }
.headOption .headOption
} }

View File

@ -8,7 +8,8 @@ object Release {
lazy val launcherRemotePath = SettingKey[String]("launcher-remote-path") lazy val launcherRemotePath = SettingKey[String]("launcher-remote-path")
lazy val deployLauncher = TaskKey[Unit]( lazy val deployLauncher = TaskKey[Unit](
"deploy-launcher", "deploy-launcher",
"Upload the launcher to its traditional location for compatibility with existing scripts.") "Upload the launcher to its traditional location for compatibility with existing scripts."
)
def launcherSettings(launcher: TaskKey[File]): Seq[Setting[_]] = Seq( def launcherSettings(launcher: TaskKey[File]): Seq[Setting[_]] = Seq(
launcherRemotePath := { launcherRemotePath := {
@ -17,11 +18,13 @@ object Release {
}, },
deployLauncher := { deployLauncher := {
val repo = bintrayRepo.value val repo = bintrayRepo.value
repo.upload(bintrayPackage.value, repo.upload(
bintrayPackage.value,
version.value, version.value,
launcherRemotePath.value, launcherRemotePath.value,
launcher.value, launcher.value,
sLog.value) sLog.value
)
} }
) )

View File

@ -45,8 +45,7 @@ object SbtLauncherPlugin extends AutoPlugin {
// TODO - is the ok for creating a jar? // TODO - is the ok for creating a jar?
val rebase: File => Seq[(File, String)] = { val rebase: File => Seq[(File, String)] = {
val path = dir.toPath val path = dir.toPath
f => f => if (f != dir) f -> path.relativize(f.toPath).toString :: Nil else Nil
if (f != dir) f -> path.relativize(f.toPath).toString :: Nil else Nil
} }
IO.zip(dir.allPaths.get().flatMap(rebase), target) IO.zip(dir.allPaths.get().flatMap(rebase), target)
} }

View File

@ -31,10 +31,12 @@ object StatusPlugin extends AutoPlugin {
val status = extracted.get(publishStatus) val status = extracted.get(publishStatus)
// Set new version AND lock down the publishStatus to what it was, as // Set new version AND lock down the publishStatus to what it was, as
// our release regexes no longer support ivy data format, due to other issues. // our release regexes no longer support ivy data format, due to other issues.
extracted.appendWithSession((version in ThisBuild ~= stamp) :: extracted.appendWithSession(
(version in ThisBuild ~= stamp) ::
(publishStatus in ThisBuild := status) :: (publishStatus in ThisBuild := status) ::
Nil, Nil,
state) state
)
} }
def stamp(v: String): String = { def stamp(v: String): String = {
val Snapshot = "-SNAPSHOT" val Snapshot = "-SNAPSHOT"

View File

@ -38,7 +38,8 @@ object Transform {
def get(key: String) = props.getOrElse(key, sys.error(s"No value defined for key '$key'")) def get(key: String) = props.getOrElse(key, sys.error(s"No value defined for key '$key'"))
val Property = """\$\{\{([\w.-]+)\}\}""".r val Property = """\$\{\{([\w.-]+)\}\}""".r
val catcher = scala.util.control.Exception.catching(classOf[java.io.IOException]) val catcher = scala.util.control.Exception.catching(classOf[java.io.IOException])
rs.map { case (in, out) => rs.map {
case (in, out) =>
val newString = Property.replaceAllIn(IO.read(in), mtch => get(mtch.group(1))) val newString = Property.replaceAllIn(IO.read(in), mtch => get(mtch.group(1)))
if (Some(newString) != catcher.opt(IO.read(out))) if (Some(newString) != catcher.opt(IO.read(out)))
IO.write(out, newString) IO.write(out, newString)

View File

@ -44,24 +44,28 @@ object Util {
lazy val apiDefinitions = TaskKey[Seq[File]]("api-definitions") lazy val apiDefinitions = TaskKey[Seq[File]]("api-definitions")
def generateAPICached(defs: Seq[File], def generateAPICached(
defs: Seq[File],
cp: Classpath, cp: Classpath,
out: File, out: File,
main: Option[String], main: Option[String],
run: ScalaRun, run: ScalaRun,
s: TaskStreams): Seq[File] = { s: TaskStreams
): Seq[File] = {
def gen() = generateAPI(defs, cp, out, main, run, s) def gen() = generateAPI(defs, cp, out, main, run, s)
val f = FileFunction.cached(s.cacheDirectory / "gen-api", FilesInfo.hash) { _ => val f = FileFunction.cached(s.cacheDirectory / "gen-api", FilesInfo.hash) { _ =>
gen().toSet gen().toSet
} // TODO: check if output directory changed } // TODO: check if output directory changed
f(defs.toSet).toSeq f(defs.toSet).toSeq
} }
def generateAPI(defs: Seq[File], def generateAPI(
defs: Seq[File],
cp: Classpath, cp: Classpath,
out: File, out: File,
main: Option[String], main: Option[String],
run: ScalaRun, run: ScalaRun,
s: TaskStreams): Seq[File] = { s: TaskStreams
): Seq[File] = {
IO.delete(out) IO.delete(out)
IO.createDirectory(out) IO.createDirectory(out)
val args = "xsbti.api" :: out.getAbsolutePath :: defs.map(_.getAbsolutePath).toList val args = "xsbti.api" :: out.getAbsolutePath :: defs.map(_.getAbsolutePath).toList
@ -73,10 +77,12 @@ object Util {
val lastCompilation = analysis.compilations.allCompilations.lastOption val lastCompilation = analysis.compilations.allCompilations.lastOption
lastCompilation.map(_.getStartTime) getOrElse 0L lastCompilation.map(_.getStartTime) getOrElse 0L
} }
def generateVersionFile(version: String, def generateVersionFile(
version: String,
dir: File, dir: File,
s: TaskStreams, s: TaskStreams,
analysis: Analysis): Seq[File] = { analysis: Analysis
): Seq[File] = {
import java.util.{ Date, TimeZone } import java.util.{ Date, TimeZone }
val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss") val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss")
formatter.setTimeZone(TimeZone.getTimeZone("GMT")) formatter.setTimeZone(TimeZone.getTimeZone("GMT"))
@ -105,8 +111,7 @@ object Util {
def cleanPom(pomNode: scala.xml.Node) = { def cleanPom(pomNode: scala.xml.Node) = {
import scala.xml._ import scala.xml._
def cleanNodes(nodes: Seq[Node]): Seq[Node] = nodes flatMap { def cleanNodes(nodes: Seq[Node]): Seq[Node] = nodes flatMap {
case elem @ Elem(_, "dependency", _, _, _*) case elem @ Elem(_, "dependency", _, _, _*) if excludePomDependency(elem) =>
if excludePomDependency(elem) =>
NodeSeq.Empty NodeSeq.Empty
case Elem(_, "classifier", _, _, _*) => case Elem(_, "classifier", _, _, _*) =>
NodeSeq.Empty NodeSeq.Empty
@ -178,14 +183,18 @@ object Licensed {
def settings: Seq[Setting[_]] = Seq( def settings: Seq[Setting[_]] = Seq(
notice := (baseDirectory.value / "NOTICE"), notice := (baseDirectory.value / "NOTICE"),
unmanagedResources in Compile ++= notice.value +: extractLicenses.value, unmanagedResources in Compile ++= notice.value +: extractLicenses.value,
extractLicenses := extractLicenses0((baseDirectory in ThisBuild).value, extractLicenses := extractLicenses0(
(baseDirectory in ThisBuild).value,
notice.value, notice.value,
streams.value) streams.value
)
) )
def extractLicenses0(base: File, note: File, s: TaskStreams): Seq[File] = def extractLicenses0(base: File, note: File, s: TaskStreams): Seq[File] =
if (!note.exists) Nil if (!note.exists) Nil
else else
try { seePaths(base, IO.read(note)) } catch { try {
seePaths(base, IO.read(note))
} catch {
case NonFatal(_) => s.log.warn("Could not read NOTICE"); Nil case NonFatal(_) => s.log.warn("Could not read NOTICE"); Nil
} }
} }

View File

@ -1 +1 @@
sbt.version=1.3.0 sbt.version=1.3.4

View File

@ -3,7 +3,7 @@ scalacOptions ++= Seq("-feature", "-language:postfixOps", "-Ywarn-unused:_,-impo
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.5") addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.5")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.2.1")
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.1") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")

View File

@ -176,7 +176,8 @@ object Serialization {
Converter.fromJson[JsonRpcRequestMessage](json) match { Converter.fromJson[JsonRpcRequestMessage](json) match {
case Success(request) => Right(request) case Success(request) => Right(request)
case Failure(e) => Left(s"Conversion error: ${e.getMessage}") case Failure(e) => Left(s"Conversion error: ${e.getMessage}")
} else }
else
Converter.fromJson[JsonRpcNotificationMessage](json) match { Converter.fromJson[JsonRpcNotificationMessage](json) match {
case Success(notification) => Right(notification) case Success(notification) => Right(notification)
case Failure(e) => Left(s"Conversion error: ${e.getMessage}") case Failure(e) => Left(s"Conversion error: ${e.getMessage}")

View File

@ -179,7 +179,8 @@ final class ScriptedTests(
case ("nio", "make-clone") => true // uses gcc which isn't set up on all systems case ("nio", "make-clone") => true // uses gcc which isn't set up on all systems
case _ => false case _ => false
} }
} else _ => false }
else _ => false
private def determineRemoteSbtCreatorKind(testName: (String, String)): RemoteSbtCreatorKind = { private def determineRemoteSbtCreatorKind(testName: (String, String)): RemoteSbtCreatorKind = {
import RemoteSbtCreatorKind._ import RemoteSbtCreatorKind._
val (group, name) = testName val (group, name) = testName
@ -417,7 +418,7 @@ final class ScriptedTests(
if (t.isInstanceOf[TestException]) { if (t.isInstanceOf[TestException]) {
t.getCause match { t.getCause match {
case null | _: SocketException => log.error(s" Cause of test exception: ${t.getMessage}") case null | _: SocketException => log.error(s" Cause of test exception: ${t.getMessage}")
case _ => t.printStackTrace() case _ => if (!pending) t.printStackTrace()
} }
log.play() log.play()
} }