mirror of https://github.com/sbt/sbt.git
1.3.0
-----BEGIN PGP SIGNATURE----- iQEcBAABAgAGBQJdbz/aAAoJEDeJDimNmiv6Am8IAKv23f6BPIWZFeokzJLkUt8v DDLyzIwzE0hTFKInCNhGDCFtACFFgoD8/7t9D5gmLttQr4F9ke94DqWBEP3kbgan Qb4rR8uwglPUJmOhzBj2Qs3A8fAXdg3wm/6OlllQzBwCYNxFf3MhmJc3hF4vd+jO 93JqwbY50entqha9z299+NpLPTKWtVC5R+1pAF+LwObjLOYqlxiGvAcl7jWx1qte VN+BabBYT4Hw43kJCutglHu8vttG68m+fqYGxjAmZXYBAbn0NPyE7GHmqkQ5baAz DUbc0vU2nY6tpUFNlNfu9PTPnRwHdSjSJTa9Ug7hw24z2oTg2tapNDXIpt6n6ZA= =onwH -----END PGP SIGNATURE----- Merge tag 'v1.3.0' into 1.3.x-merge 1.3.0
This commit is contained in:
commit
7c2a1c858b
|
|
@ -306,7 +306,10 @@ object Tests {
|
|||
fun: TestFunction,
|
||||
tags: Seq[(Tag, Int)]
|
||||
): Task[Map[String, SuiteResult]] = {
|
||||
val base = task { (name, fun.apply()) }
|
||||
val base = Task[(String, (SuiteResult, Seq[TestTask]))](
|
||||
Info[(String, (SuiteResult, Seq[TestTask]))]().setName(name),
|
||||
Pure(() => (name, fun.apply()), `inline` = false)
|
||||
)
|
||||
val taggedBase = base.tagw(tags: _*).tag(fun.tags.map(ConcurrentRestrictions.Tag(_)): _*)
|
||||
taggedBase flatMap {
|
||||
case (name, (result, nested)) =>
|
||||
|
|
|
|||
|
|
@ -298,14 +298,13 @@ object Defaults extends BuildCommon {
|
|||
turbo :== SysProp.turbo,
|
||||
useSuperShell := { if (insideCI.value) false else SysProp.supershell },
|
||||
progressReports := {
|
||||
val progress = (ThisBuild / useSuperShell).value
|
||||
val rs = EvaluateTask.taskTimingProgress.toVector ++
|
||||
EvaluateTask.taskTraceEvent.toVector ++ {
|
||||
if (progress) Vector(EvaluateTask.taskProgress)
|
||||
else Vector()
|
||||
}
|
||||
val rs = EvaluateTask.taskTimingProgress.toVector ++ EvaluateTask.taskTraceEvent.toVector
|
||||
rs map { Keys.TaskProgress(_) }
|
||||
},
|
||||
progressState := {
|
||||
if ((ThisBuild / useSuperShell).value) Some(new ProgressState(SysProp.supershellBlankZone))
|
||||
else None
|
||||
},
|
||||
Previous.cache := new Previous(
|
||||
Def.streamsManagerKey.value,
|
||||
Previous.references.value.getReferences
|
||||
|
|
@ -2041,7 +2040,12 @@ object Classpaths {
|
|||
excludeFilter in unmanagedJars value
|
||||
)
|
||||
).map(exportClasspath) ++ Seq(
|
||||
sbt.nio.Keys.dependencyClasspathFiles := data(dependencyClasspath.value).map(_.toPath),
|
||||
dependencyClasspathFiles := data(dependencyClasspath.value).map(_.toPath),
|
||||
dependencyClasspathFiles / outputFileStamps := {
|
||||
val cache = managedFileStampCache.value
|
||||
val stamper = outputFileStamper.value
|
||||
dependencyClasspathFiles.value.flatMap(p => cache.getOrElseUpdate(p, stamper).map(p -> _))
|
||||
}
|
||||
)
|
||||
|
||||
private[this] def exportClasspath(s: Setting[Task[Classpath]]): Setting[Task[Classpath]] =
|
||||
|
|
|
|||
|
|
@ -156,12 +156,8 @@ object EvaluateTask {
|
|||
|
||||
lazy private val sharedProgress = new TaskTimings(reportOnShutdown = true)
|
||||
def taskTimingProgress: Option[ExecuteProgress[Task]] =
|
||||
if (SysProp.taskTimings) {
|
||||
if (SysProp.taskTimingsOnShutdown)
|
||||
Some(sharedProgress)
|
||||
else
|
||||
Some(new TaskTimings(reportOnShutdown = false))
|
||||
} else None
|
||||
if (SysProp.taskTimingsOnShutdown) Some(sharedProgress)
|
||||
else None
|
||||
|
||||
lazy private val sharedTraceEvent = new TaskTraceEvent()
|
||||
def taskTraceEvent: Option[ExecuteProgress[Task]] =
|
||||
|
|
@ -169,12 +165,6 @@ object EvaluateTask {
|
|||
Some(sharedTraceEvent)
|
||||
} else None
|
||||
|
||||
def taskProgress: ExecuteProgress[Task] = {
|
||||
val appender = MainAppender.defaultScreen(StandardMain.console)
|
||||
val log = LogManager.progressLogger(appender)
|
||||
new TaskProgress(log)
|
||||
}
|
||||
|
||||
// sbt-pgp calls this
|
||||
@deprecated("No longer used", "1.3.0")
|
||||
private[sbt] def defaultProgress(): ExecuteProgress[Task] = ExecuteProgress.empty[Task]
|
||||
|
|
@ -240,11 +230,19 @@ object EvaluateTask {
|
|||
extracted,
|
||||
structure
|
||||
)
|
||||
val reporters = maker map { _.progress }
|
||||
// configure the logger for super shell
|
||||
ConsoleAppender.setShowProgress((reporters collect {
|
||||
case p: TaskProgress => ()
|
||||
}).nonEmpty)
|
||||
val progressReporter = extracted.get(progressState in ThisBuild).map { ps =>
|
||||
ps.reset()
|
||||
ConsoleAppender.setShowProgress(true)
|
||||
val appender = MainAppender.defaultScreen(StandardMain.console)
|
||||
appender match {
|
||||
case c: ConsoleAppender => c.setProgressState(ps)
|
||||
case _ =>
|
||||
}
|
||||
val log = LogManager.progressLogger(appender)
|
||||
new TaskProgress(log)
|
||||
}
|
||||
val reporters = maker.map(_.progress) ++ progressReporter ++
|
||||
(if (SysProp.taskTimings) new TaskTimings(reportOnShutdown = false) :: Nil else Nil)
|
||||
reporters match {
|
||||
case xs if xs.isEmpty => ExecuteProgress.empty[Task]
|
||||
case xs if xs.size == 1 => xs.head
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import sbt.internal.inc.ScalaInstance
|
|||
import sbt.internal.io.WatchState
|
||||
import sbt.internal.librarymanagement.{ CompatibilityWarningOptions, IvySbt }
|
||||
import sbt.internal.server.ServerHandler
|
||||
import sbt.internal.util.{ AttributeKey, SourcePosition }
|
||||
import sbt.internal.util.{ AttributeKey, ProgressState, SourcePosition }
|
||||
import sbt.io._
|
||||
import sbt.librarymanagement.Configurations.CompilerPlugin
|
||||
import sbt.librarymanagement.LibraryManagementCodec._
|
||||
|
|
@ -484,6 +484,7 @@ object Keys {
|
|||
val turbo = settingKey[Boolean]("Enables (true) or disables optional performance features.")
|
||||
// This key can be used to add custom ExecuteProgress instances
|
||||
val progressReports = settingKey[Seq[TaskProgress]]("A function that returns a list of progress reporters.").withRank(DTask)
|
||||
private[sbt] val progressState = settingKey[Option[ProgressState]]("The optional progress state if supershell is enabled.").withRank(Invisible)
|
||||
private[sbt] val postProgressReports = settingKey[Unit]("Internally used to modify logger.").withRank(DTask)
|
||||
@deprecated("No longer used", "1.3.0")
|
||||
private[sbt] val executeProgress = settingKey[State => TaskProgress]("Experimental task execution listener.").withRank(DTask)
|
||||
|
|
|
|||
|
|
@ -136,8 +136,10 @@ object ScriptedPlugin extends AutoPlugin {
|
|||
val groupP = token(id.examples(pairMap.keySet)) <~ token('/')
|
||||
|
||||
// A parser for page definitions
|
||||
val pageP: Parser[ScriptedTestPage] = ("*" ~ NatBasic ~ "of" ~ NatBasic) map {
|
||||
case _ ~ page ~ _ ~ total => ScriptedTestPage(page, total)
|
||||
val pageNumber = NatBasic & not('0', "zero page number")
|
||||
val pageP: Parser[ScriptedTestPage] = ("*" ~> pageNumber ~ ("of" ~> pageNumber)) flatMap {
|
||||
case (page, total) if page <= total => success(ScriptedTestPage(page, total))
|
||||
case (page, total) => failure(s"Page $page was greater than $total")
|
||||
}
|
||||
|
||||
// Grabs the filenames from a given test group in the current page definition.
|
||||
|
|
|
|||
|
|
@ -140,7 +140,12 @@ object LogManager {
|
|||
val screenTrace = getOr(traceLevel.key, data, scope, state, defaultTraceLevel(state))
|
||||
val backingTrace = getOr(persistTraceLevel.key, data, scope, state, Int.MaxValue)
|
||||
val extraBacked = state.globalLogging.backed :: relay :: Nil
|
||||
val ps = Project.extract(state).get(sbt.Keys.progressState in ThisBuild)
|
||||
val consoleOpt = consoleLocally(state, console)
|
||||
consoleOpt foreach {
|
||||
case a: ConsoleAppender => ps.foreach(a.setProgressState)
|
||||
case _ =>
|
||||
}
|
||||
val config = MainAppender.MainAppenderConfig(
|
||||
consoleOpt,
|
||||
backed,
|
||||
|
|
|
|||
|
|
@ -88,9 +88,10 @@ object SysProp {
|
|||
|
||||
def fileCacheSize: Long =
|
||||
SizeParser(System.getProperty("sbt.file.cache.size", "128M")).getOrElse(128L * 1024 * 1024)
|
||||
def supershell: Boolean = color && getOrTrue("sbt.supershell")
|
||||
def supershell: Boolean = booleanOpt("sbt.supershell").getOrElse(color)
|
||||
|
||||
def supershellSleep: Long = long("sbt.supershell.sleep", 100L)
|
||||
def supershellBlankZone: Int = int("sbt.supershell.blankzone", 5)
|
||||
|
||||
def defaultUseCoursier: Boolean = {
|
||||
val coursierOpt = booleanOpt("sbt.coursier")
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ object Dependencies {
|
|||
def nightlyVersion: Option[String] = sys.props.get("sbt.build.version")
|
||||
|
||||
// sbt modules
|
||||
private val ioVersion = nightlyVersion.getOrElse("1.3.0-M17")
|
||||
private val utilVersion = nightlyVersion.getOrElse("1.3.0-M12")
|
||||
private val ioVersion = nightlyVersion.getOrElse("1.3.0")
|
||||
private val utilVersion = nightlyVersion.getOrElse("1.3.0")
|
||||
private val lmVersion =
|
||||
sys.props.get("sbt.build.lm.version") match {
|
||||
case Some(version) => version
|
||||
case _ => nightlyVersion.getOrElse("1.3.0-M8")
|
||||
case _ => nightlyVersion.getOrElse("1.3.0")
|
||||
}
|
||||
val zincVersion = nightlyVersion.getOrElse("1.3.0-M9")
|
||||
val zincVersion = nightlyVersion.getOrElse("1.3.0")
|
||||
|
||||
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
|
||||
|
|
|
|||
|
|
@ -53,8 +53,10 @@ object Scripted {
|
|||
val groupP = token(id.examples(pairMap.keySet)) <~ token('/')
|
||||
|
||||
// A parser for page definitions
|
||||
val pageP: Parser[ScriptedTestPage] = ("*" ~ NatBasic ~ "of" ~ NatBasic) map {
|
||||
case _ ~ page ~ _ ~ total => ScriptedTestPage(page, total)
|
||||
val pageNumber = NatBasic & not('0', "zero page number")
|
||||
val pageP: Parser[ScriptedTestPage] = ("*" ~> pageNumber ~ ("of" ~> pageNumber)) flatMap {
|
||||
case (page, total) if page <= total => success(ScriptedTestPage(page, total))
|
||||
case (page, total) => failure(s"Page $page was greater than $total")
|
||||
}
|
||||
|
||||
// Grabs the filenames from a given test group in the current page definition.
|
||||
|
|
|
|||
|
|
@ -244,8 +244,9 @@ class JUnitXmlTestsListener(val outputDir: String, logger: Logger) extends Tests
|
|||
new File(targetDir, s"TEST-${normalizeName(withTestSuite(_.name))}.xml").getAbsolutePath
|
||||
// TODO would be nice to have a logger and log this with level debug
|
||||
// System.err.println("Writing JUnit XML test report: " + file)
|
||||
XML.save(legacyFile, withTestSuite(_.stop()), "UTF-8", true, null)
|
||||
XML.save(file, withTestSuite(_.stop()), "UTF-8", true, null)
|
||||
val testSuiteResult = withTestSuite(_.stop())
|
||||
XML.save(legacyFile, testSuiteResult, "UTF-8", true, null)
|
||||
XML.save(file, testSuiteResult, "UTF-8", true, null)
|
||||
testSuite.remove()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue