Upgrade scalariform version

This commit is contained in:
Dale Wijnand 2016-11-24 14:12:23 +00:00
parent 6a46c62524
commit 43821667bf
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
56 changed files with 469 additions and 371 deletions

View File

@ -74,7 +74,8 @@ object CacheIvy {
implicit def moduleReportFormat(implicit cf: Format[Seq[Caller]], ff: Format[File]): Format[ModuleReport] = { implicit def moduleReportFormat(implicit cf: Format[Seq[Caller]], ff: Format[File]): Format[ModuleReport] = {
wrap[ModuleReport, (ModuleID, Seq[(Artifact, File)], Seq[Artifact], Option[String], Option[Long], Option[String], Option[String], Boolean, Option[String], Option[String], Option[String], Option[String], Map[String, String], Option[Boolean], Option[String], Seq[String], Seq[(String, Option[String])], Seq[Caller])]( wrap[ModuleReport, (ModuleID, Seq[(Artifact, File)], Seq[Artifact], Option[String], Option[Long], Option[String], Option[String], Boolean, Option[String], Option[String], Option[String], Option[String], Map[String, String], Option[Boolean], Option[String], Seq[String], Seq[(String, Option[String])], Seq[Caller])](
m => (m.module, m.artifacts, m.missingArtifacts, m.status, m.publicationDate map { _.getTime }, m.resolver, m.artifactResolver, m.evicted, m.evictedData, m.evictedReason, m.problem, m.homepage, m.extraAttributes, m.isDefault, m.branch, m.configurations, m.licenses, m.callers), m => (m.module, m.artifacts, m.missingArtifacts, m.status, m.publicationDate map { _.getTime }, m.resolver, m.artifactResolver, m.evicted, m.evictedData, m.evictedReason, m.problem, m.homepage, m.extraAttributes, m.isDefault, m.branch, m.configurations, m.licenses, m.callers),
{ case (m, as, ms, s, pd, r, a, e, ed, er, p, h, ea, d, b, cs, ls, ks) => new ModuleReport(m, as, ms, s, pd map { new ju.Date(_) }, r, a, e, ed, er, p, h, ea, d, b, cs, ls, ks) }) { case (m, as, ms, s, pd, r, a, e, ed, er, p, h, ea, d, b, cs, ls, ks) => new ModuleReport(m, as, ms, s, pd map { new ju.Date(_) }, r, a, e, ed, er, p, h, ea, d, b, cs, ls, ks) }
)
} }
implicit def artifactFormat(implicit sf: Format[String], uf: Format[Option[URL]]): Format[Artifact] = { implicit def artifactFormat(implicit sf: Format[String], uf: Format[Option[URL]]): Format[Artifact] = {
wrap[Artifact, (String, String, String, Option[String], Seq[Configuration], Option[URL], Map[String, String])]( wrap[Artifact, (String, String, String, Option[String], Seq[Configuration], Option[URL], Map[String, String])](
@ -85,8 +86,10 @@ object CacheIvy {
implicit def organizationArtifactReportFormat(implicit sf: Format[String], bf: Format[Boolean], df: Format[Seq[ModuleReport]]): Format[OrganizationArtifactReport] = implicit def organizationArtifactReportFormat(implicit sf: Format[String], bf: Format[Boolean], df: Format[Seq[ModuleReport]]): Format[OrganizationArtifactReport] =
wrap[OrganizationArtifactReport, (String, String, Seq[ModuleReport])](m => (m.organization, m.name, m.modules), { case (o, n, r) => OrganizationArtifactReport(o, n, r) }) wrap[OrganizationArtifactReport, (String, String, Seq[ModuleReport])](m => (m.organization, m.name, m.modules), { case (o, n, r) => OrganizationArtifactReport(o, n, r) })
implicit def callerFormat: Format[Caller] = implicit def callerFormat: Format[Caller] =
wrap[Caller, (ModuleID, Seq[String], Map[String, String], Boolean, Boolean, Boolean, Boolean)](c => (c.caller, c.callerConfigurations, c.callerExtraAttributes, c.isForceDependency, c.isChangingDependency, c.isTransitiveDependency, c.isDirectlyForceDependency), wrap[Caller, (ModuleID, Seq[String], Map[String, String], Boolean, Boolean, Boolean, Boolean)](
{ case (c, cc, ea, fd, cd, td, df) => new Caller(c, cc, ea, fd, cd, td, df) }) c => (c.caller, c.callerConfigurations, c.callerExtraAttributes, c.isForceDependency, c.isChangingDependency, c.isTransitiveDependency, c.isDirectlyForceDependency),
{ case (c, cc, ea, fd, cd, td, df) => new Caller(c, cc, ea, fd, cd, td, df) }
)
implicit def exclusionRuleFormat(implicit sf: Format[String]): Format[InclExclRule] = implicit def exclusionRuleFormat(implicit sf: Format[String]): Format[InclExclRule] =
wrap[InclExclRule, (String, String, String, Seq[String])](e => (e.organization, e.name, e.artifact, e.configurations), { case (o, n, a, cs) => InclExclRule(o, n, a, cs) }) wrap[InclExclRule, (String, String, String, Seq[String])](e => (e.organization, e.name, e.artifact, e.configurations), { case (o, n, a, cs) => InclExclRule(o, n, a, cs) })
implicit def crossVersionFormat: Format[CrossVersion] = wrap(crossToInt, crossFromInt) implicit def crossVersionFormat: Format[CrossVersion] = wrap(crossToInt, crossFromInt)

View File

@ -24,11 +24,13 @@ object Doc {
def javadoc(label: String, cache: File, doc: JavaTools, log: Logger, reporter: Reporter): Gen = def javadoc(label: String, cache: File, doc: JavaTools, log: Logger, reporter: Reporter): Gen =
javadoc(label, cache, doc, log, reporter, Seq()) javadoc(label, cache, doc, log, reporter, Seq())
def javadoc(label: String, cache: File, doc: JavaTools, log: Logger, reporter: Reporter, fileInputOptions: Seq[String]): Gen = def javadoc(label: String, cache: File, doc: JavaTools, log: Logger, reporter: Reporter, fileInputOptions: Seq[String]): Gen =
cached(cache, fileInputOptions, prepare(label + " Java API documentation", filterSources(javaSourcesOnly, cached(cache, fileInputOptions, prepare(label + " Java API documentation", filterSources(
javaSourcesOnly,
(sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], maxErrors: Int, log: Logger) => { (sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], maxErrors: Int, log: Logger) => {
// doc.doc // doc.doc
??? ???
}))) }
)))
val javaSourcesOnly: File => Boolean = _.getName.endsWith(".java") val javaSourcesOnly: File => Boolean = _.getName.endsWith(".java")

View File

@ -77,7 +77,8 @@ object TestResultLogger {
printSummary: TestResultLogger = Defaults.printSummary, printSummary: TestResultLogger = Defaults.printSummary,
printStandard: TestResultLogger = Defaults.printStandard, printStandard: TestResultLogger = Defaults.printStandard,
printFailures: TestResultLogger = Defaults.printFailures, printFailures: TestResultLogger = Defaults.printFailures,
printNoTests: TestResultLogger = Defaults.printNoTests) extends TestResultLogger { printNoTests: TestResultLogger = Defaults.printNoTests
) extends TestResultLogger {
override def run(log: Logger, results: Output, taskName: String): Unit = { override def run(log: Logger, results: Output, taskName: String): Unit = {
def run(r: TestResultLogger): Unit = r.run(log, results, taskName) def run(r: TestResultLogger): Unit = r.run(log, results, taskName)
@ -154,7 +155,6 @@ object TestResultLogger {
}) })
val printNoTests = TestResultLogger((log, results, taskName) => val printNoTests = TestResultLogger((log, results, taskName) =>
log.info("No tests to run for " + taskName) log.info("No tests to run for " + taskName))
)
} }
} }

View File

@ -120,7 +120,8 @@ object Tests {
val tests: Seq[TestDefinition], val tests: Seq[TestDefinition],
val setup: Seq[ClassLoader => Unit], val setup: Seq[ClassLoader => Unit],
val cleanup: Seq[ClassLoader => Unit], val cleanup: Seq[ClassLoader => Unit],
val testListeners: Seq[TestReportListener]) val testListeners: Seq[TestReportListener]
)
private[sbt] def processOptions(config: Execution, discovered: Seq[TestDefinition], log: Logger): ProcessedOptions = private[sbt] def processOptions(config: Execution, discovered: Seq[TestDefinition], log: Logger): ProcessedOptions =
{ {
import collection.mutable.{ HashSet, ListBuffer } import collection.mutable.{ HashSet, ListBuffer }

View File

@ -55,7 +55,8 @@ class CacheIvyTest extends Properties("CacheIvy") {
} yield ModuleID( } yield ModuleID(
organization = o, name = n, revision = r, configurations = cs, isChanging = isChanging, isTransitive = isTransitive, organization = o, name = n, revision = r, configurations = cs, isChanging = isChanging, isTransitive = isTransitive,
isForce = isForce, explicitArtifacts = explicitArtifacts, inclusions = inclusions, exclusions = exclusions, isForce = isForce, explicitArtifacts = explicitArtifacts, inclusions = inclusions, exclusions = exclusions,
extraAttributes = extraAttributes, crossVersion = crossVersion, branchName = branch) extraAttributes = extraAttributes, crossVersion = crossVersion, branchName = branch
)
} }
property("moduleIDFormat") = forAll { (m: ModuleID) => property("moduleIDFormat") = forAll { (m: ModuleID) =>

View File

@ -32,7 +32,8 @@ final case class State(
history: State.History, history: State.History,
attributes: AttributeMap, attributes: AttributeMap,
globalLogging: GlobalLogging, globalLogging: GlobalLogging,
next: State.Next) extends Identity { next: State.Next
) extends Identity {
lazy val combinedParser = Command.combine(definedCommands)(this) lazy val combinedParser = Command.combine(definedCommands)(this)
} }

View File

@ -38,7 +38,6 @@ private[sbt] final class NetworkChannel extends CommandChannel {
server.publish( server.publish(
if (cmdStatus.canEnter) StatusEvent(Ready) if (cmdStatus.canEnter) StatusEvent(Ready)
else StatusEvent(Processing("TODO current command", cmdStatus.state.remainingCommands)) else StatusEvent(Processing("TODO current command", cmdStatus.state.remainingCommands))
) ))
)
} }
} }

View File

@ -24,21 +24,29 @@ object Serialization {
def toMessage(event: Event): EventMessage = def toMessage(event: Event): EventMessage =
event match { event match {
case LogEvent(level, message) => case LogEvent(level, message) =>
EventMessage(`type` = "logEvent", EventMessage(
`type` = "logEvent",
status = None, commandQueue = Vector(), status = None, commandQueue = Vector(),
level = Some(level), message = Some(message), success = None, commandLine = None) level = Some(level), message = Some(message), success = None, commandLine = None
)
case StatusEvent(Ready) => case StatusEvent(Ready) =>
EventMessage(`type` = "statusEvent", EventMessage(
`type` = "statusEvent",
status = Some("ready"), commandQueue = Vector(), status = Some("ready"), commandQueue = Vector(),
level = None, message = None, success = None, commandLine = None) level = None, message = None, success = None, commandLine = None
)
case StatusEvent(Processing(command, commandQueue)) => case StatusEvent(Processing(command, commandQueue)) =>
EventMessage(`type` = "statusEvent", EventMessage(
`type` = "statusEvent",
status = Some("processing"), commandQueue = commandQueue.toVector, status = Some("processing"), commandQueue = commandQueue.toVector,
level = None, message = None, success = None, commandLine = None) level = None, message = None, success = None, commandLine = None
)
case ExecutionEvent(command, status) => case ExecutionEvent(command, status) =>
EventMessage(`type` = "executionEvent", EventMessage(
`type` = "executionEvent",
status = None, commandQueue = Vector(), status = None, commandQueue = Vector(),
level = None, message = None, success = Some(status), commandLine = Some(command)) level = None, message = None, success = Some(status), commandLine = Some(command)
)
} }
/** /**

View File

@ -20,8 +20,7 @@ final class InputTask[T] private (val parser: State => Parser[Task[T]]) {
case Left(msg) => case Left(msg) =>
val indented = msg.lines.map(" " + _).mkString("\n") val indented = msg.lines.map(" " + _).mkString("\n")
Parser.failure(s"Invalid programmatic input:\n$indented") Parser.failure(s"Invalid programmatic input:\n$indented")
} })
)
} }
object InputTask { object InputTask {
@ -38,9 +37,7 @@ object InputTask {
case Left(msg) => case Left(msg) =>
val indented = msg.lines.map(" " + _).mkString("\n") val indented = msg.lines.map(" " + _).mkString("\n")
sys.error(s"Invalid programmatic input:\n$indented") sys.error(s"Invalid programmatic input:\n$indented")
} }))
)
)
) )
} }

View File

@ -142,7 +142,8 @@ object Scope {
projectInherit: ProjectRef => Seq[ProjectRef], projectInherit: ProjectRef => Seq[ProjectRef],
configInherit: (ResolvedReference, ConfigKey) => Seq[ConfigKey], configInherit: (ResolvedReference, ConfigKey) => Seq[ConfigKey],
taskInherit: AttributeKey[_] => Seq[AttributeKey[_]], taskInherit: AttributeKey[_] => Seq[AttributeKey[_]],
extraInherit: (ResolvedReference, AttributeMap) => Seq[AttributeMap]): Scope => Seq[Scope] = extraInherit: (ResolvedReference, AttributeMap) => Seq[AttributeMap]
): Scope => Seq[Scope] =
{ {
val index = delegates(refs, configurations, projectInherit, configInherit) val index = delegates(refs, configurations, projectInherit, configInherit)
scope => indexedDelegates(resolve, index, rootProject, taskInherit, extraInherit)(scope) scope => indexedDelegates(resolve, index, rootProject, taskInherit, extraInherit)(scope)
@ -153,7 +154,8 @@ object Scope {
index: DelegateIndex, index: DelegateIndex,
rootProject: URI => String, rootProject: URI => String,
taskInherit: AttributeKey[_] => Seq[AttributeKey[_]], taskInherit: AttributeKey[_] => Seq[AttributeKey[_]],
extraInherit: (ResolvedReference, AttributeMap) => Seq[AttributeMap])(rawScope: Scope): Seq[Scope] = extraInherit: (ResolvedReference, AttributeMap) => Seq[AttributeMap]
)(rawScope: Scope): Seq[Scope] =
{ {
val scope = Scope.replaceThis(GlobalScope)(rawScope) val scope = Scope.replaceThis(GlobalScope)(rawScope)
@ -190,7 +192,8 @@ object Scope {
refs: Seq[(ProjectRef, Proj)], refs: Seq[(ProjectRef, Proj)],
configurations: Proj => Seq[ConfigKey], configurations: Proj => Seq[ConfigKey],
projectInherit: ProjectRef => Seq[ProjectRef], projectInherit: ProjectRef => Seq[ProjectRef],
configInherit: (ResolvedReference, ConfigKey) => Seq[ConfigKey]): DelegateIndex = configInherit: (ResolvedReference, ConfigKey) => Seq[ConfigKey]
): DelegateIndex =
{ {
val pDelegates = refs map { val pDelegates = refs map {
case (ref, project) => case (ref, project) =>

View File

@ -54,9 +54,7 @@ object FullInstance extends Instance.Composed[Initialize, Task](InitializeInstan
def flattenFun[S, T](in: Initialize[Task[S => Initialize[Task[T]]]]): Initialize[S => Task[T]] = def flattenFun[S, T](in: Initialize[Task[S => Initialize[Task[T]]]]): Initialize[S => Task[T]] =
{ {
import Scoped._ import Scoped._
(in, settingsData, Def.capturedTransformations) apply { (in, settingsData, Def.capturedTransformations) apply { (a: Task[S => Initialize[Task[T]]], data: Task[SS], f) => (s: S) =>
(a: Task[S => Initialize[Task[T]]], data: Task[SS], f) =>
(s: S) =>
import TaskExtra.multT2Task import TaskExtra.multT2Task
(a, data) flatMap { case (af, d) => f(af(s)) evaluate d } (a, data) flatMap { case (af, d) => f(af(s)) evaluate d }
} }

View File

@ -265,7 +265,8 @@ object Defaults extends BuildCommon {
def compileBase = inTask(console)(compilersSetting :: Nil) ++ compileBaseGlobal ++ Seq( def compileBase = inTask(console)(compilersSetting :: Nil) ++ compileBaseGlobal ++ Seq(
incOptions := incOptions.value.withClassfileManagerType( incOptions := incOptions.value.withClassfileManagerType(
Maybe.just(new TransactionalManagerType(crossTarget.value / "classes.bak", sbt.util.Logger.Null))), Maybe.just(new TransactionalManagerType(crossTarget.value / "classes.bak", sbt.util.Logger.Null))
),
scalaInstance := scalaInstanceTask.value, scalaInstance := scalaInstanceTask.value,
crossVersion := (if (crossPaths.value) CrossVersion.binary else CrossVersion.Disabled), crossVersion := (if (crossPaths.value) CrossVersion.binary else CrossVersion.Disabled),
crossTarget := makeCrossTarget(target.value, scalaBinaryVersion.value, sbtBinaryVersion.value, sbtPlugin.value, crossPaths.value), crossTarget := makeCrossTarget(target.value, scalaBinaryVersion.value, sbtBinaryVersion.value, sbtPlugin.value, crossPaths.value),
@ -678,7 +679,8 @@ object Defaults extends BuildCommon {
} }
)) ++ )) ++
inTask(packageSrc)(Seq( inTask(packageSrc)(Seq(
packageOptions := Package.addSpecManifestAttributes(name.value, version.value, organizationName.value) +: packageOptions.value)) ++ packageOptions := Package.addSpecManifestAttributes(name.value, version.value, organizationName.value) +: packageOptions.value
)) ++
packageTaskSettings(packageBin, packageBinMappings) ++ packageTaskSettings(packageBin, packageBinMappings) ++
packageTaskSettings(packageSrc, packageSrcMappings) ++ packageTaskSettings(packageSrc, packageSrcMappings) ++
packageTaskSettings(packageDoc, packageDocMappings) ++ packageTaskSettings(packageDoc, packageDocMappings) ++
@ -947,7 +949,8 @@ object Defaults extends BuildCommon {
(compilerReporter in compile).value, (compilerReporter in compile).value,
o2m(None), o2m(None),
// TODO - task / setting for extra, // TODO - task / setting for extra,
Array.empty) Array.empty
)
} }
def compileInputsSettings: Seq[Setting[_]] = { def compileInputsSettings: Seq[Setting[_]] = {
Seq( Seq(
@ -959,13 +962,15 @@ object Defaults extends BuildCommon {
javacOptions.value.toArray, javacOptions.value.toArray,
maxErrors.value, maxErrors.value,
f1(Compiler.foldMappers(sourcePositionMappers.value)), f1(Compiler.foldMappers(sourcePositionMappers.value)),
compileOrder.value), compileOrder.value
),
compilerReporter := new LoggerReporter(maxErrors.value, streams.value.log, Compiler.foldMappers(sourcePositionMappers.value)), compilerReporter := new LoggerReporter(maxErrors.value, streams.value.log, Compiler.foldMappers(sourcePositionMappers.value)),
compileInputs := new Inputs( compileInputs := new Inputs(
compilers.value, compilers.value,
compileOptions.value, compileOptions.value,
compileIncSetup.value, compileIncSetup.value,
previousCompile.value) previousCompile.value
)
) )
} }
def compileAnalysisSettings: Seq[Setting[_]] = Seq( def compileAnalysisSettings: Seq[Setting[_]] = Seq(

View File

@ -11,8 +11,16 @@ import sbt.librarymanagement.{ Resolver, UpdateReport }
import scala.concurrent.duration.Duration import scala.concurrent.duration.Duration
import java.io.File import java.io.File
import Def.{ dummyState, ScopedKey, Setting } import Def.{ dummyState, ScopedKey, Setting }
import Keys.{ Streams, TaskStreams, dummyRoots, executionRoots, pluginData, streams, import Keys.{
streamsManager, transformState } Streams,
TaskStreams,
dummyRoots,
executionRoots,
pluginData,
streams,
streamsManager,
transformState
}
import Project.richInitializeTask import Project.richInitializeTask
import Scope.GlobalScope import Scope.GlobalScope
import scala.Console.RED import scala.Console.RED
@ -97,21 +105,25 @@ sealed trait EvaluateTaskConfig {
} }
object EvaluateTaskConfig { object EvaluateTaskConfig {
@deprecated("Use the alternative that specifies minForcegcInterval", "0.13.9") @deprecated("Use the alternative that specifies minForcegcInterval", "0.13.9")
def apply(restrictions: Seq[Tags.Rule], def apply(
restrictions: Seq[Tags.Rule],
checkCycles: Boolean, checkCycles: Boolean,
progressReporter: ExecuteProgress[Task], progressReporter: ExecuteProgress[Task],
cancelStrategy: TaskCancellationStrategy, cancelStrategy: TaskCancellationStrategy,
forceGarbageCollection: Boolean): EvaluateTaskConfig = forceGarbageCollection: Boolean
): EvaluateTaskConfig =
apply(restrictions, checkCycles, progressReporter, cancelStrategy, forceGarbageCollection, apply(restrictions, checkCycles, progressReporter, cancelStrategy, forceGarbageCollection,
GCUtil.defaultMinForcegcInterval) GCUtil.defaultMinForcegcInterval)
/** Raw constructor for EvaluateTaskConfig. */ /** Raw constructor for EvaluateTaskConfig. */
def apply(restrictions: Seq[Tags.Rule], def apply(
restrictions: Seq[Tags.Rule],
checkCycles: Boolean, checkCycles: Boolean,
progressReporter: ExecuteProgress[Task], progressReporter: ExecuteProgress[Task],
cancelStrategy: TaskCancellationStrategy, cancelStrategy: TaskCancellationStrategy,
forceGarbageCollection: Boolean, forceGarbageCollection: Boolean,
minForcegcInterval: Duration): EvaluateTaskConfig = { minForcegcInterval: Duration
): EvaluateTaskConfig = {
val r = restrictions val r = restrictions
val check = checkCycles val check = checkCycles
val cs = cancelStrategy val cs = cancelStrategy

View File

@ -63,7 +63,8 @@ final case class Extracted(structure: BuildStructure, session: SessionSettings,
import EvaluateTask._ import EvaluateTask._
val scopedKey = Scoped.scopedSetting( val scopedKey = Scoped.scopedSetting(
Scope.resolveScope(Load.projectScope(currentRef), currentRef.build, structure.rootProject)(key.scope), key.key) Scope.resolveScope(Load.projectScope(currentRef), currentRef.build, structure.rootProject)(key.scope), key.key
)
val rkey = resolve(scopedKey.scopedKey) val rkey = resolve(scopedKey.scopedKey)
val inputTask = get(Scoped.scopedSetting(rkey.scope, rkey.key)) val inputTask = get(Scoped.scopedSetting(rkey.scope, rkey.key))
val task = Parser.parse(input, inputTask.parser(state)) match { val task = Parser.parse(input, inputTask.parser(state)) match {

View File

@ -31,9 +31,11 @@ object LogManager {
def withScreenLogger(mk: (ScopedKey[_], State) => AbstractLogger): LogManager = withLoggers(screen = mk) def withScreenLogger(mk: (ScopedKey[_], State) => AbstractLogger): LogManager = withLoggers(screen = mk)
def withLoggers(screen: (ScopedKey[_], State) => AbstractLogger = (sk, s) => defaultScreen(s.globalLogging.console), def withLoggers(
screen: (ScopedKey[_], State) => AbstractLogger = (sk, s) => defaultScreen(s.globalLogging.console),
backed: PrintWriter => AbstractLogger = defaultBacked(), backed: PrintWriter => AbstractLogger = defaultBacked(),
extra: ScopedKey[_] => Seq[AbstractLogger] = _ => Nil): LogManager = new LogManager { extra: ScopedKey[_] => Seq[AbstractLogger] = _ => Nil
): LogManager = new LogManager {
def apply(data: Settings[Scope], state: State, task: ScopedKey[_], to: PrintWriter): Logger = def apply(data: Settings[Scope], state: State, task: ScopedKey[_], to: PrintWriter): Logger =
defaultLogger(data, state, task, screen(task, state), backed(to), extra(task).toList) defaultLogger(data, state, task, screen(task, state), backed(to), extra(task).toList)
} }

View File

@ -49,28 +49,31 @@ final class xMain extends xsbti.AppMain {
import BasicCommandStrings.runEarly import BasicCommandStrings.runEarly
import BuiltinCommands.defaults import BuiltinCommands.defaults
import sbt.internal.CommandStrings.{ BootCommand, DefaultsCommand, InitCommand } import sbt.internal.CommandStrings.{ BootCommand, DefaultsCommand, InitCommand }
runManaged(initialState(configuration, runManaged(initialState(
configuration,
Seq(defaults, early), Seq(defaults, early),
runEarly(DefaultsCommand) :: runEarly(InitCommand) :: BootCommand :: Nil) runEarly(DefaultsCommand) :: runEarly(InitCommand) :: BootCommand :: Nil
) ))
} }
} }
final class ScriptMain extends xsbti.AppMain { final class ScriptMain extends xsbti.AppMain {
def run(configuration: xsbti.AppConfiguration): xsbti.MainResult = def run(configuration: xsbti.AppConfiguration): xsbti.MainResult =
{ {
import BasicCommandStrings.runEarly import BasicCommandStrings.runEarly
runManaged(initialState(configuration, runManaged(initialState(
configuration,
BuiltinCommands.ScriptCommands, BuiltinCommands.ScriptCommands,
runEarly(Level.Error.toString) :: Script.Name :: Nil) runEarly(Level.Error.toString) :: Script.Name :: Nil
) ))
} }
} }
final class ConsoleMain extends xsbti.AppMain { final class ConsoleMain extends xsbti.AppMain {
def run(configuration: xsbti.AppConfiguration): xsbti.MainResult = def run(configuration: xsbti.AppConfiguration): xsbti.MainResult =
runManaged(initialState(configuration, runManaged(initialState(
configuration,
BuiltinCommands.ConsoleCommands, BuiltinCommands.ConsoleCommands,
IvyConsole.Name :: Nil) IvyConsole.Name :: Nil
) ))
} }
object StandardMain { object StandardMain {

View File

@ -60,16 +60,19 @@ import sbt.util.Logger
* then the `MyPlugin` settings (and anything that activates only when `MyPlugin` is activated) will not be added. * then the `MyPlugin` settings (and anything that activates only when `MyPlugin` is activated) will not be added.
*/ */
abstract class AutoPlugin extends Plugins.Basic with PluginsFunctions { abstract class AutoPlugin extends Plugins.Basic with PluginsFunctions {
/** Determines whether this AutoPlugin will be activated for this project when the `requires` clause is satisfied. /**
* Determines whether this AutoPlugin will be activated for this project when the `requires` clause is satisfied.
* *
* When this method returns `allRequirements`, and `requires` method returns `Web && Javascript`, this plugin * When this method returns `allRequirements`, and `requires` method returns `Web && Javascript`, this plugin
* instance will be added automatically if the `Web` and `Javascript` plugins are enabled. * instance will be added automatically if the `Web` and `Javascript` plugins are enabled.
* *
* When this method returns `noTrigger`, and `requires` method returns `Web && Javascript`, this plugin * When this method returns `noTrigger`, and `requires` method returns `Web && Javascript`, this plugin
* instance will be added only if the build user enables it, but it will automatically add both `Web` and `Javascript`. */ * instance will be added only if the build user enables it, but it will automatically add both `Web` and `Javascript`.
*/
def trigger: PluginTrigger = noTrigger def trigger: PluginTrigger = noTrigger
/** This AutoPlugin requires the plugins the [[Plugins]] matcher returned by this method. See [[trigger]]. /**
* This AutoPlugin requires the plugins the [[Plugins]] matcher returned by this method. See [[trigger]].
*/ */
def requires: Plugins = plugins.JvmPlugin def requires: Plugins = plugins.JvmPlugin
@ -83,9 +86,11 @@ abstract class AutoPlugin extends Plugins.Basic with PluginsFunctions {
/** The [[Setting]]s to add in the scope of each project that activates this AutoPlugin. */ /** The [[Setting]]s to add in the scope of each project that activates this AutoPlugin. */
def projectSettings: Seq[Setting[_]] = Nil def projectSettings: Seq[Setting[_]] = Nil
/** The [[Setting]]s to add to the build scope for each project that activates this AutoPlugin. /**
* The [[Setting]]s to add to the build scope for each project that activates this AutoPlugin.
* The settings returned here are guaranteed to be added to a given build scope only once * The settings returned here are guaranteed to be added to a given build scope only once
* regardless of how many projects for that build activate this AutoPlugin. */ * regardless of how many projects for that build activate this AutoPlugin.
*/
def buildSettings: Seq[Setting[_]] = Nil def buildSettings: Seq[Setting[_]] = Nil
/** The [[Setting]]s to add to the global scope exactly once if any project activates this AutoPlugin. */ /** The [[Setting]]s to add to the global scope exactly once if any project activates this AutoPlugin. */
@ -101,7 +106,6 @@ abstract class AutoPlugin extends Plugins.Basic with PluginsFunctions {
private[sbt] def unary_! : Exclude = Exclude(this) private[sbt] def unary_! : Exclude = Exclude(this)
/** If this plugin does not have any requirements, it means it is actually a root plugin. */ /** If this plugin does not have any requirements, it means it is actually a root plugin. */
private[sbt] final def isRoot: Boolean = private[sbt] final def isRoot: Boolean =
requires match { requires match {
@ -114,8 +118,10 @@ abstract class AutoPlugin extends Plugins.Basic with PluginsFunctions {
isRoot && (trigger == AllRequirements) isRoot && (trigger == AllRequirements)
} }
/** An error that occurs when auto-plugins aren't configured properly. /**
* It translates the error from the underlying logic system to be targeted at end users. */ * An error that occurs when auto-plugins aren't configured properly.
* It translates the error from the underlying logic system to be targeted at end users.
*/
final class AutoPluginException private (val message: String, val origin: Option[LogicException]) extends RuntimeException(message) { final class AutoPluginException private (val message: String, val origin: Option[LogicException]) extends RuntimeException(message) {
/** Prepends `p` to the error message derived from `origin`. */ /** Prepends `p` to the error message derived from `origin`. */
def withPrefix(p: String) = new AutoPluginException(p + message, origin) def withPrefix(p: String) = new AutoPluginException(p + message, origin)
@ -134,7 +140,6 @@ sealed trait Plugins {
def &&(o: Basic): Plugins def &&(o: Basic): Plugins
} }
sealed trait PluginsFunctions { sealed trait PluginsFunctions {
/** [[Plugins]] instance that doesn't require any [[Plugins]]s. */ /** [[Plugins]] instance that doesn't require any [[Plugins]]s. */
def empty: Plugins = Plugins.Empty def empty: Plugins = Plugins.Empty
@ -146,8 +151,10 @@ sealed trait PluginsFunctions {
} }
object Plugins extends PluginsFunctions { object Plugins extends PluginsFunctions {
/** Given the available auto plugins `defined`, returns a function that selects [[AutoPlugin]]s for the provided [[AutoPlugin]]s. /**
* The [[AutoPlugin]]s are topologically sorted so that a required [[AutoPlugin]] comes before its requiring [[AutoPlugin]].*/ * Given the available auto plugins `defined`, returns a function that selects [[AutoPlugin]]s for the provided [[AutoPlugin]]s.
* The [[AutoPlugin]]s are topologically sorted so that a required [[AutoPlugin]] comes before its requiring [[AutoPlugin]].
*/
def deducer(defined0: List[AutoPlugin]): (Plugins, Logger) => Seq[AutoPlugin] = def deducer(defined0: List[AutoPlugin]): (Plugins, Logger) => Seq[AutoPlugin] =
if (defined0.isEmpty) (_, _) => Nil if (defined0.isEmpty) (_, _) => Nil
else { else {
@ -218,8 +225,7 @@ object Plugins extends PluginsFunctions {
private[this] def duplicateProvidesError(byAtom: Seq[(Atom, AutoPlugin)]): Unit = { private[this] def duplicateProvidesError(byAtom: Seq[(Atom, AutoPlugin)]): Unit = {
val dupsByAtom = byAtom.groupBy(_._1).mapValues(_.map(_._2)) val dupsByAtom = byAtom.groupBy(_._1).mapValues(_.map(_._2))
val dupStrings = for( (atom, dups) <- dupsByAtom if dups.size > 1 ) yield val dupStrings = for ((atom, dups) <- dupsByAtom if dups.size > 1) yield s"${atom.label} by ${dups.mkString(", ")}"
s"${atom.label} by ${dups.mkString(", ")}"
val (ns, nl) = if (dupStrings.size > 1) ("s", "\n\t") else ("", " ") val (ns, nl) = if (dupStrings.size > 1) ("s", "\n\t") else ("", " ")
val message = s"Plugin$ns provided by multiple AutoPlugins:$nl${dupStrings.mkString(nl)}" val message = s"Plugin$ns provided by multiple AutoPlugins:$nl${dupStrings.mkString(nl)}"
throw AutoPluginException(message) throw AutoPluginException(message)

View File

@ -94,16 +94,17 @@ sealed trait Project extends ProjectDefinition[ProjectReference] {
private[sbt] def delegatesEval: Eval[Seq[ProjectReference]] private[sbt] def delegatesEval: Eval[Seq[ProjectReference]]
private[sbt] def dependenciesEval: Eval[Seq[ClasspathDep[ProjectReference]]] private[sbt] def dependenciesEval: Eval[Seq[ClasspathDep[ProjectReference]]]
// TODO: add parameters for plugins in 0.14.0 (not reasonable to do in a binary compatible way in 0.13) // TODO: add parameters for plugins in 0.14.0 (not reasonable to do in a binary compatible way in 0.13)
private[sbt] def copy(id: String = id, private[sbt] def copy(
id: String = id,
base: File = base, base: File = base,
aggregateEval: Eval[Seq[ProjectReference]] = aggregateEval, aggregateEval: Eval[Seq[ProjectReference]] = aggregateEval,
dependenciesEval: Eval[Seq[ClasspathDep[ProjectReference]]] = dependenciesEval, dependenciesEval: Eval[Seq[ClasspathDep[ProjectReference]]] = dependenciesEval,
delegatesEval: Eval[Seq[ProjectReference]] = delegatesEval, delegatesEval: Eval[Seq[ProjectReference]] = delegatesEval,
settingsEval: Eval[Seq[Setting[_]]] = settingsEval, settingsEval: Eval[Seq[Setting[_]]] = settingsEval,
configurations: Seq[Configuration] = configurations, configurations: Seq[Configuration] = configurations,
auto: AddSettings = auto): Project = auto: AddSettings = auto
): Project =
unresolved(id, base, unresolved(id, base,
aggregateEval = aggregateEval, aggregateEval = aggregateEval,
dependenciesEval = dependenciesEval, dependenciesEval = dependenciesEval,
@ -280,7 +281,8 @@ object Project extends ProjectExtra {
val auto: AddSettings, val auto: AddSettings,
val plugins: Plugins, val plugins: Plugins,
val autoPlugins: Seq[AutoPlugin], val autoPlugins: Seq[AutoPlugin],
val projectOrigin: ProjectOrigin) extends ProjectDefinition[PR] { val projectOrigin: ProjectOrigin
) extends ProjectDefinition[PR] {
def aggregate: Seq[PR] = aggregateEval.get def aggregate: Seq[PR] = aggregateEval.get
def dependencies: Seq[ClasspathDep[PR]] = dependenciesEval.get def dependencies: Seq[ClasspathDep[PR]] = dependenciesEval.get
def delegates: Seq[PR] = delegatesEval.get def delegates: Seq[PR] = delegatesEval.get
@ -665,7 +667,6 @@ trait ProjectExtra extends ProjectExtra0 {
implicit def configDependencyConstructor[T](p: T)(implicit ev: T => ProjectReference): Constructor = new Constructor(p) implicit def configDependencyConstructor[T](p: T)(implicit ev: T => ProjectReference): Constructor = new Constructor(p)
implicit def classpathDependency[T](p: T)(implicit ev: T => ProjectReference): ClasspathDep[ProjectReference] = new ClasspathDependency(p, None) implicit def classpathDependency[T](p: T)(implicit ev: T => ProjectReference): ClasspathDep[ProjectReference] = new ClasspathDependency(p, None)
// These used to be in Project so that they didn't need to get imported (due to Initialize being nested in Project). // These used to be in Project so that they didn't need to get imported (due to Initialize being nested in Project).
// Moving Initialize and other settings types to Def and decoupling Project, Def, and Structure means these go here for now // Moving Initialize and other settings types to Def and decoupling Project, Def, and Structure means these go here for now
implicit def richInitializeTask[T](init: Initialize[Task[T]]): Scoped.RichInitializeTask[T] = new Scoped.RichInitializeTask(init) implicit def richInitializeTask[T](init: Initialize[Task[T]]): Scoped.RichInitializeTask[T] = new Scoped.RichInitializeTask(init)

View File

@ -28,8 +28,7 @@ object SessionVar {
def persist[T](key: ScopedKey[Task[T]], state: State, value: T)(implicit f: sbinary.Format[T]): Unit = def persist[T](key: ScopedKey[Task[T]], state: State, value: T)(implicit f: sbinary.Format[T]): Unit =
Project.structure(state).streams(state).use(key)(s => Project.structure(state).streams(state).use(key)(s =>
Operations.write(s.binary(DefaultDataID), value)(f) Operations.write(s.binary(DefaultDataID), value)(f))
)
def clear(s: State): State = s.put(sessionVars, SessionVar.emptyMap) def clear(s: State): State = s.put(sessionVars, SessionVar.emptyMap)

View File

@ -253,8 +253,7 @@ object Act {
def evaluate(kvs: Seq[ScopedKey[_]]): Parser[() => State] = { def evaluate(kvs: Seq[ScopedKey[_]]): Parser[() => State] = {
val preparedPairs = anyKeyValues(structure, kvs) val preparedPairs = anyKeyValues(structure, kvs)
val showConfig = Aggregation.defaultShow(state, showTasks = action == ShowAction) val showConfig = Aggregation.defaultShow(state, showTasks = action == ShowAction)
evaluatingParser(state, structure, showConfig)(preparedPairs) map { evaluate => evaluatingParser(state, structure, showConfig)(preparedPairs) map { evaluate => () => {
() => {
val keyStrings = preparedPairs.map(pp => showKey(pp.key)).mkString(", ") val keyStrings = preparedPairs.map(pp => showKey(pp.key)).mkString(", ")
state.log.debug("Evaluating tasks: " + keyStrings) state.log.debug("Evaluating tasks: " + keyStrings)
evaluate() evaluate()

View File

@ -150,8 +150,7 @@ object Aggregation {
} else { } else {
val base = if (tasks.isEmpty) success(() => s) else val base = if (tasks.isEmpty) success(() => s) else
applyTasks(s, structure, maps(tasks)(x => success(castToAny(x))), show) applyTasks(s, structure, maps(tasks)(x => success(castToAny(x))), show)
base.map { res => base.map { res => () =>
() =>
val newState = res() val newState = res()
if (show.settingValues && settings.nonEmpty) printSettings(settings, show.print) if (show.settingValues && settings.nonEmpty) printSettings(settings, show.print)
newState newState
@ -169,8 +168,7 @@ object Aggregation {
{ {
val resRef = proj.map(p => extra.projectRefFor(extra.resolveRef(p))) val resRef = proj.map(p => extra.projectRefFor(extra.resolveRef(p)))
resRef.toList.flatMap(ref => resRef.toList.flatMap(ref =>
if (reverse) extra.aggregates.reverse(ref) else extra.aggregates.forward(ref) if (reverse) extra.aggregates.reverse(ref) else extra.aggregates.forward(ref))
)
} }
def aggregate[T, Proj](key: ScopedKey[T], rawMask: ScopeMask, extra: BuildUtil[Proj], reverse: Boolean = false): Seq[ScopedKey[T]] = def aggregate[T, Proj](key: ScopedKey[T], rawMask: ScopeMask, extra: BuildUtil[Proj], reverse: Boolean = false): Seq[ScopedKey[T]] =

View File

@ -105,23 +105,22 @@ final class BuildLoader(
val builders: MultiHandler[BuildInfo, () => BuildUnit], val builders: MultiHandler[BuildInfo, () => BuildUnit],
val transformer: Transformer, val transformer: Transformer,
val full: MultiHandler[LoadInfo, () => BuildUnit], val full: MultiHandler[LoadInfo, () => BuildUnit],
val transformAll: TransformAll) { val transformAll: TransformAll
) {
def addNonRoot(uri: URI, loaders: Components): BuildLoader = def addNonRoot(uri: URI, loaders: Components): BuildLoader =
new BuildLoader(fail, state, config, new BuildLoader(fail, state, config,
resolvers.addNonRoot(uri, loaders.resolver), resolvers.addNonRoot(uri, loaders.resolver),
builders.addNonRoot(uri, loaders.builder), builders.addNonRoot(uri, loaders.builder),
seq(transformer, loaders.transformer), seq(transformer, loaders.transformer),
full.addNonRoot(uri, loaders.full), full.addNonRoot(uri, loaders.full),
transformAll andThen loaders.transformAll transformAll andThen loaders.transformAll)
)
def setRoot(loaders: Components): BuildLoader = def setRoot(loaders: Components): BuildLoader =
new BuildLoader(fail, state, config, new BuildLoader(fail, state, config,
resolvers.setRoot(loaders.resolver), resolvers.setRoot(loaders.resolver),
builders.setRoot(loaders.builder), builders.setRoot(loaders.builder),
seq(loaders.transformer, transformer), seq(loaders.transformer, transformer),
full.setRoot(loaders.full), full.setRoot(loaders.full),
loaders.transformAll andThen transformAll loaders.transformAll andThen transformAll)
)
def resetPluginDepth: BuildLoader = copyWithNewPM(config.pluginManagement.resetDepth) def resetPluginDepth: BuildLoader = copyWithNewPM(config.pluginManagement.resetDepth)
def updatePluginManagement(overrides: Set[ModuleID]): BuildLoader = def updatePluginManagement(overrides: Set[ModuleID]): BuildLoader =

View File

@ -30,7 +30,8 @@ final class StructureIndex(
val taskToKey: Map[Task[_], ScopedKey[Task[_]]], val taskToKey: Map[Task[_], ScopedKey[Task[_]]],
val triggers: Triggers[Task], val triggers: Triggers[Task],
val keyIndex: KeyIndex, val keyIndex: KeyIndex,
val aggregateKeyIndex: KeyIndex) val aggregateKeyIndex: KeyIndex
)
/** /**
* A resolved build unit. (`ResolvedBuildUnit` would be a better name to distinguish it from the loaded, but unresolved `BuildUnit`.) * A resolved build unit. (`ResolvedBuildUnit` would be a better name to distinguish it from the loaded, but unresolved `BuildUnit`.)
@ -92,13 +93,16 @@ final class LoadedDefinitions(
val builds: Seq[BuildDef], val builds: Seq[BuildDef],
val projects: Seq[Project], val projects: Seq[Project],
val buildNames: Seq[String], val buildNames: Seq[String],
val dslDefinitions: DefinedSbtValues) { val dslDefinitions: DefinedSbtValues
def this(base: File, ) {
def this(
base: File,
target: Seq[File], target: Seq[File],
loader: ClassLoader, loader: ClassLoader,
builds: Seq[BuildDef], builds: Seq[BuildDef],
projects: Seq[Project], projects: Seq[Project],
buildNames: Seq[String]) = this(base, target, loader, builds, projects, buildNames, DefinedSbtValues.empty) buildNames: Seq[String]
) = this(base, target, loader, builds, projects, buildNames, DefinedSbtValues.empty)
} }
/** Auto-detected top-level modules (as in `object X`) of type `T` paired with their source names. */ /** Auto-detected top-level modules (as in `object X`) of type `T` paired with their source names. */

View File

@ -12,7 +12,8 @@ final class BuildUtil[Proj](
val rootProjectID: URI => String, val rootProjectID: URI => String,
val project: (URI, String) => Proj, val project: (URI, String) => Proj,
val configurations: Proj => Seq[ConfigKey], val configurations: Proj => Seq[ConfigKey],
val aggregates: Relation[ProjectRef, ProjectRef]) { val aggregates: Relation[ProjectRef, ProjectRef]
) {
def rootProject(uri: URI): Proj = def rootProject(uri: URI): Proj =
project(uri, rootProjectID(uri)) project(uri, rootProjectID(uri))

View File

@ -181,11 +181,13 @@ private[sbt] object EvaluateConfigurations {
case e: sbt.compiler.EvalException => throw new MessageOnlyException(e.getMessage) case e: sbt.compiler.EvalException => throw new MessageOnlyException(e.getMessage)
} }
// TODO - keep track of configuration classes defined. // TODO - keep track of configuration classes defined.
TrackedEvalResult(result.generated, TrackedEvalResult(
result.generated,
loader => { loader => {
val pos = RangePosition(name, range shift 1) val pos = RangePosition(name, range shift 1)
result.getValue(loader).asInstanceOf[DslEntry].withPos(pos) result.getValue(loader).asInstanceOf[DslEntry].withPos(pos)
}) }
)
} }
/** /**

View File

@ -16,9 +16,24 @@ import sbt.internal.inc.{ Analysis, ClasspathOptionsUtil, ModuleUtilities }
import sbt.internal.inc.classpath.ClasspathUtilities import sbt.internal.inc.classpath.ClasspathUtilities
import Project.inScope import Project.inScope
import Def.{ isDummy, ScopedKey, ScopeLocal, Setting } import Def.{ isDummy, ScopedKey, ScopeLocal, Setting }
import Keys.{ appConfiguration, baseDirectory, configuration, exportedProducts, fullClasspath, fullResolvers, import Keys.{
loadedBuild, onLoadMessage, pluginData, resolvedScoped, sbtPlugin, scalacOptions, streams, appConfiguration,
thisProject, thisProjectRef, update } baseDirectory,
configuration,
exportedProducts,
fullClasspath,
fullResolvers,
loadedBuild,
onLoadMessage,
pluginData,
resolvedScoped,
sbtPlugin,
scalacOptions,
streams,
thisProject,
thisProjectRef,
update
}
import tools.nsc.reporters.ConsoleReporter import tools.nsc.reporters.ConsoleReporter
import sbt.internal.util.{ Attributed, Eval => Ev, Settings, Show, ~> } import sbt.internal.util.{ Attributed, Eval => Ev, Settings, Show, ~> }
import sbt.internal.util.Attributed.data import sbt.internal.util.Attributed.data
@ -547,7 +562,8 @@ private[sbt] object Load {
makeOrDiscoverRoot: Boolean, makeOrDiscoverRoot: Boolean,
buildUri: URI, buildUri: URI,
context: PluginManagement.Context, context: PluginManagement.Context,
generatedConfigClassFiles: Seq[File]): LoadedProjects = generatedConfigClassFiles: Seq[File]
): LoadedProjects =
{ {
// load all relevant configuration files (.sbt, as .scala already exists at this point) // load all relevant configuration files (.sbt, as .scala already exists at this point)
def discover(auto: AddSettings, base: File): DiscoveredProjects = def discover(auto: AddSettings, base: File): DiscoveredProjects =
@ -638,7 +654,8 @@ private[sbt] object Load {
root: Option[Project], root: Option[Project],
nonRoot: Seq[Project], nonRoot: Seq[Project],
sbtFiles: Seq[File], sbtFiles: Seq[File],
generatedFiles: Seq[File]) generatedFiles: Seq[File]
)
/** /**
* This method attempts to resolve/apply all configuration loaded for a project. It is responsible for the following: * This method attempts to resolve/apply all configuration loaded for a project. It is responsible for the following:
@ -660,7 +677,8 @@ private[sbt] object Load {
loadedPlugins: LoadedPlugins, loadedPlugins: LoadedPlugins,
globalUserSettings: InjectSettings, globalUserSettings: InjectSettings,
memoSettings: mutable.Map[File, LoadedSbtFile], memoSettings: mutable.Map[File, LoadedSbtFile],
log: Logger): Project = { log: Logger
): Project = {
import AddSettings._ import AddSettings._
val autoConfigs = projectPlugins.flatMap(_.projectConfigurations) val autoConfigs = projectPlugins.flatMap(_.projectConfigurations)
@ -707,7 +725,8 @@ private[sbt] object Load {
projectBase: File, projectBase: File,
loadedPlugins: LoadedPlugins, loadedPlugins: LoadedPlugins,
eval: () => Eval, eval: () => Eval,
memoSettings: mutable.Map[File, LoadedSbtFile]): DiscoveredProjects = { memoSettings: mutable.Map[File, LoadedSbtFile]
): DiscoveredProjects = {
// Default sbt files to read, if needed // Default sbt files to read, if needed
lazy val defaultSbtFiles = configurationSources(projectBase) lazy val defaultSbtFiles = configurationSources(projectBase)
@ -915,7 +934,8 @@ final case class LoadBuildConfiguration(
injectSettings: Load.InjectSettings, injectSettings: Load.InjectSettings,
globalPlugin: Option[GlobalPlugin], globalPlugin: Option[GlobalPlugin],
extraBuilds: Seq[URI], extraBuilds: Seq[URI],
log: Logger) { log: Logger
) {
lazy val (globalPluginClasspath, _) = Load.pluginDefinitionLoader(this, Load.globalPluginClasspath(globalPlugin)) lazy val (globalPluginClasspath, _) = Load.pluginDefinitionLoader(this, Load.globalPluginClasspath(globalPlugin))
private[sbt] lazy val globalPluginDefs = { private[sbt] lazy val globalPluginDefs = {

View File

@ -16,7 +16,8 @@ private[sbt] final class LoadedSbtFile(
// TODO - we may want to expose a simpler interface on top of here for the set command, // TODO - we may want to expose a simpler interface on top of here for the set command,
// rather than what we have now... // rather than what we have now...
val definitions: DefinedSbtValues, val definitions: DefinedSbtValues,
val generatedFiles: Seq[File]) { val generatedFiles: Seq[File]
) {
// We still use merge for now. We track originating sbt file in an alternative manner. // We still use merge for now. We track originating sbt file in an alternative manner.
def merge(o: LoadedSbtFile): LoadedSbtFile = def merge(o: LoadedSbtFile): LoadedSbtFile =
new LoadedSbtFile( new LoadedSbtFile(
@ -25,7 +26,8 @@ private[sbt] final class LoadedSbtFile(
importedDefs ++ o.importedDefs, importedDefs ++ o.importedDefs,
manipulations, manipulations,
definitions zip o.definitions, definitions zip o.definitions,
generatedFiles ++ o.generatedFiles) generatedFiles ++ o.generatedFiles
)
def clearProjects = new LoadedSbtFile(settings, Nil, importedDefs, manipulations, definitions, generatedFiles) def clearProjects = new LoadedSbtFile(settings, Nil, importedDefs, manipulations, definitions, generatedFiles)
} }

View File

@ -10,8 +10,10 @@ import sbt.util.Logger
import java.net.URI import java.net.URI
private[sbt] class PluginsDebug(val available: List[AutoPlugin], val nameToKey: Map[String, AttributeKey[_]], val provided: Relation[AutoPlugin, AttributeKey[_]]) { private[sbt] class PluginsDebug(val available: List[AutoPlugin], val nameToKey: Map[String, AttributeKey[_]], val provided: Relation[AutoPlugin, AttributeKey[_]]) {
/** The set of [[AutoPlugin]]s that might define a key named `keyName`. /**
* Because plugins can define keys in different scopes, this should only be used as a guideline. */ * The set of [[AutoPlugin]]s that might define a key named `keyName`.
* Because plugins can define keys in different scopes, this should only be used as a guideline.
*/
def providers(keyName: String): Set[AutoPlugin] = nameToKey.get(keyName) match { def providers(keyName: String): Set[AutoPlugin] = nameToKey.get(keyName) match {
case None => Set.empty case None => Set.empty
case Some(key) => provided.reverse(key) case Some(key) => provided.reverse(key)
@ -44,8 +46,7 @@ private[sbt] class PluginsDebug(val available: List[AutoPlugin], val nameToKey:
def impossiblePlugins = impossible.map(_.plugin.label).mkString(", ") def impossiblePlugins = impossible.map(_.plugin.label).mkString(", ")
val imPostfix = if (impossible.isEmpty) "" else s"\n\nThere are other available plugins that provide $notFoundKey, but they are impossible to add: $impossiblePlugins" val imPostfix = if (impossible.isEmpty) "" else s"\n\nThere are other available plugins that provide $notFoundKey, but they are impossible to add: $impossiblePlugins"
possibleString + imPostfix possibleString + imPostfix
} } else if (impossible.isEmpty)
else if(impossible.isEmpty)
s"No available plugin provides key $notFoundKey." s"No available plugin provides key $notFoundKey."
else { else {
val explanations = impossible.map(explainPluginEnable) val explanations = impossible.map(explainPluginEnable)
@ -82,8 +83,7 @@ private[sbt] class PluginsDebug(val available: List[AutoPlugin], val nameToKey:
private[sbt] object PluginsDebug { private[sbt] object PluginsDebug {
def helpAll(s: State): String = def helpAll(s: State): String =
if(Project.isProjectLoaded(s)) if (Project.isProjectLoaded(s)) {
{
val extracted = Project.extract(s) val extracted = Project.extract(s)
import extracted._ import extracted._
def helpBuild(uri: URI, build: LoadedBuildUnit): String = def helpBuild(uri: URI, build: LoadedBuildUnit): String =
@ -97,8 +97,7 @@ private[sbt] object PluginsDebug {
} }
val buildStrings = for ((uri, build) <- structure.units) yield helpBuild(uri, build) val buildStrings = for ((uri, build) <- structure.units) yield helpBuild(uri, build)
buildStrings.mkString("\n") buildStrings.mkString("\n")
} } else "No project is currently loaded."
else "No project is currently loaded."
def autoPluginMap(s: State): Map[String, AutoPlugin] = def autoPluginMap(s: State): Map[String, AutoPlugin] =
{ {
@ -148,11 +147,13 @@ private[sbt] object PluginsDebug {
new PluginsDebug(available, nameToKey, keyR) new PluginsDebug(available, nameToKey, keyR)
} }
/** The context for debugging a plugin (de)activation. /**
* The context for debugging a plugin (de)activation.
* @param initial The initially defined [[AutoPlugin]]s. * @param initial The initially defined [[AutoPlugin]]s.
* @param enabled The resulting model. * @param enabled The resulting model.
* @param deducePlugin The function used to compute the model. * @param deducePlugin The function used to compute the model.
* @param available All [[AutoPlugin]]s available for consideration. */ * @param available All [[AutoPlugin]]s available for consideration.
*/
final case class Context(initial: Plugins, enabled: Seq[AutoPlugin], deducePlugin: (Plugins, Logger) => Seq[AutoPlugin], available: List[AutoPlugin], log: Logger) final case class Context(initial: Plugins, enabled: Seq[AutoPlugin], deducePlugin: (Plugins, Logger) => Seq[AutoPlugin], available: List[AutoPlugin], log: Logger)
/** Describes the steps to activate a plugin in some context. */ /** Describes the steps to activate a plugin in some context. */
@ -163,19 +164,23 @@ private[sbt] object PluginsDebug {
/** Describes a [[plugin]] that cannot be activated in a [[context]] due to [[contradictions]] in requirements. */ /** Describes a [[plugin]] that cannot be activated in a [[context]] due to [[contradictions]] in requirements. */
final case class PluginImpossible(plugin: AutoPlugin, context: Context, contradictions: Set[AutoPlugin]) extends EnableDeactivated final case class PluginImpossible(plugin: AutoPlugin, context: Context, contradictions: Set[AutoPlugin]) extends EnableDeactivated
/** Describes the requirements for activating [[plugin]] in [[context]]. /**
* Describes the requirements for activating [[plugin]] in [[context]].
* @param context The base plugins, exclusions, and ultimately activated plugins * @param context The base plugins, exclusions, and ultimately activated plugins
* @param blockingExcludes Existing exclusions that prevent [[plugin]] from being activated and must be dropped * @param blockingExcludes Existing exclusions that prevent [[plugin]] from being activated and must be dropped
* @param enablingPlugins [[AutoPlugin]]s that are not currently enabled, but need to be enabled for [[plugin]] to activate * @param enablingPlugins [[AutoPlugin]]s that are not currently enabled, but need to be enabled for [[plugin]] to activate
* @param extraEnabledPlugins Plugins that will be enabled as a result of [[plugin]] activating, but are not required for [[plugin]] to activate * @param extraEnabledPlugins Plugins that will be enabled as a result of [[plugin]] activating, but are not required for [[plugin]] to activate
* @param willRemove Plugins that will be deactivated as a result of [[plugin]] activating * @param willRemove Plugins that will be deactivated as a result of [[plugin]] activating
* @param deactivate Describes plugins that must be deactivated for [[plugin]] to activate. These require an explicit exclusion or dropping a transitive [[AutoPlugin]].*/ * @param deactivate Describes plugins that must be deactivated for [[plugin]] to activate. These require an explicit exclusion or dropping a transitive [[AutoPlugin]].
*/
final case class PluginRequirements(plugin: AutoPlugin, context: Context, blockingExcludes: Set[AutoPlugin], enablingPlugins: Set[AutoPlugin], extraEnabledPlugins: Set[AutoPlugin], willRemove: Set[AutoPlugin], deactivate: List[DeactivatePlugin]) extends EnableDeactivated final case class PluginRequirements(plugin: AutoPlugin, context: Context, blockingExcludes: Set[AutoPlugin], enablingPlugins: Set[AutoPlugin], extraEnabledPlugins: Set[AutoPlugin], willRemove: Set[AutoPlugin], deactivate: List[DeactivatePlugin]) extends EnableDeactivated
/** Describes a [[plugin]] that must be removed in order to activate another plugin in some context. /**
* Describes a [[plugin]] that must be removed in order to activate another plugin in some context.
* The [[plugin]] can always be directly, explicitly excluded. * The [[plugin]] can always be directly, explicitly excluded.
* @param removeOneOf If non-empty, removing one of these [[AutoPlugin]]s will deactivate [[plugin]] without affecting the other plugin. If empty, a direct exclusion is required. * @param removeOneOf If non-empty, removing one of these [[AutoPlugin]]s will deactivate [[plugin]] without affecting the other plugin. If empty, a direct exclusion is required.
* @param newlySelected If false, this plugin was selected in the original context. */ * @param newlySelected If false, this plugin was selected in the original context.
*/
final case class DeactivatePlugin(plugin: AutoPlugin, removeOneOf: Set[AutoPlugin], newlySelected: Boolean) final case class DeactivatePlugin(plugin: AutoPlugin, removeOneOf: Set[AutoPlugin], newlySelected: Boolean)
/** Determines how to enable [[plugin]] in [[context]]. */ /** Determines how to enable [[plugin]] in [[context]]. */
@ -295,8 +300,10 @@ private[sbt] object PluginsDebug {
case PluginActivated(plugin, context) => s"Plugin ${plugin.label} already activated." case PluginActivated(plugin, context) => s"Plugin ${plugin.label} already activated."
} }
/** Provides a [[Relation]] between plugins and the keys they potentially define. /**
* Because plugins can define keys in different scopes and keys can be overridden, this is not definitive.*/ * Provides a [[Relation]] between plugins and the keys they potentially define.
* Because plugins can define keys in different scopes and keys can be overridden, this is not definitive.
*/
def definedKeys(available: List[AutoPlugin]): Relation[AutoPlugin, AttributeKey[_]] = def definedKeys(available: List[AutoPlugin]): Relation[AutoPlugin, AttributeKey[_]] =
{ {
def extractDefinedKeys(ss: Seq[Setting[_]]): Seq[AttributeKey[_]] = def extractDefinedKeys(ss: Seq[Setting[_]]): Seq[AttributeKey[_]] =

View File

@ -34,12 +34,14 @@ object SettingGraph {
} }
} }
case class SettingGraph(name: String, case class SettingGraph(
name: String,
definedIn: Option[String], definedIn: Option[String],
data: Option[ScopedKeyData[_]], data: Option[ScopedKeyData[_]],
description: Option[String], description: Option[String],
basedir: File, basedir: File,
depends: Set[SettingGraph]) { depends: Set[SettingGraph]
) {
def dataString: String = def dataString: String =
data map { d => data map { d =>
d.settingValue map { d.settingValue map {
@ -48,9 +50,11 @@ case class SettingGraph(name: String,
} getOrElse { d.typeName } } getOrElse { d.typeName }
} getOrElse { "" } } getOrElse { "" }
def dependsAscii: String = Graph.toAscii(this, def dependsAscii: String = Graph.toAscii(
this,
(x: SettingGraph) => x.depends.toSeq.sortBy(_.name), (x: SettingGraph) => x.depends.toSeq.sortBy(_.name),
(x: SettingGraph) => "%s = %s" format (x.definedIn getOrElse { "" }, x.dataString)) (x: SettingGraph) => "%s = %s" format (x.definedIn getOrElse { "" }, x.dataString)
)
} }
object Graph { object Graph {

View File

@ -9,8 +9,10 @@ import Def._
trait TaskSequential { trait TaskSequential {
def sequential[B](last: Initialize[Task[B]]): Initialize[Task[B]] = def sequential[B](last: Initialize[Task[B]]): Initialize[Task[B]] =
sequential(Nil, last) sequential(Nil, last)
def sequential[A0, B](task0: Initialize[Task[A0]], def sequential[A0, B](
last: Initialize[Task[B]]): Initialize[Task[B]] = task0: Initialize[Task[A0]],
last: Initialize[Task[B]]
): Initialize[Task[B]] =
sequential(List(unitTask(task0)), last) sequential(List(unitTask(task0)), last)
def sequential[A0, A1, B](task0: Initialize[Task[A0]], task1: Initialize[Task[A1]], def sequential[A0, A1, B](task0: Initialize[Task[A0]], task1: Initialize[Task[A1]],
last: Initialize[Task[B]]): Initialize[Task[B]] = last: Initialize[Task[B]]): Initialize[Task[B]] =

View File

@ -4,7 +4,8 @@ package plugins
import Def.Setting import Def.Setting
import Keys._ import Keys._
/** An experimental plugin that adds the ability for junit-xml to be generated. /**
* An experimental plugin that adds the ability for junit-xml to be generated.
* *
* To disable this plugin, you need to add: * To disable this plugin, you need to add:
* {{{ * {{{

View File

@ -5,7 +5,8 @@ import sbt.librarymanagement.{ Configuration, Configurations }
import Def.Setting import Def.Setting
/** A plugin representing the ability to build a JVM project. /**
* A plugin representing the ability to build a JVM project.
* *
* Core tasks/keys: * Core tasks/keys:
* - `run` * - `run`

View File

@ -4,8 +4,7 @@ import org.specs2._
import mutable.Specification import mutable.Specification
import sbt.util.Logger import sbt.util.Logger
object PluginsTest extends Specification object PluginsTest extends Specification {
{
import AI._ import AI._
"Auto plugin" should { "Auto plugin" should {
@ -47,8 +46,7 @@ object PluginsTest extends Specification
} }
} }
object AI object AI {
{
lazy val allPlugins: List[AutoPlugin] = List(A, B, Q, R, S, T, U) lazy val allPlugins: List[AutoPlugin] = List(A, B, Q, R, S, T, U)
lazy val deducePlugin = Plugins.deducer(allPlugins) lazy val deducePlugin = Plugins.deducer(allPlugins)
lazy val log = Logger.Null lazy val log = Logger.Null
@ -56,35 +54,30 @@ object AI
object A extends AutoPlugin { override def requires = empty } object A extends AutoPlugin { override def requires = empty }
object B extends AutoPlugin { override def requires = empty } object B extends AutoPlugin { override def requires = empty }
object Q extends AutoPlugin object Q extends AutoPlugin {
{
override def requires: Plugins = A && B override def requires: Plugins = A && B
override def trigger = allRequirements override def trigger = allRequirements
} }
object R extends AutoPlugin object R extends AutoPlugin {
{
override def requires = Q override def requires = Q
override def trigger = allRequirements override def trigger = allRequirements
} }
object S extends AutoPlugin object S extends AutoPlugin {
{
override def requires = Q && !R override def requires = Q && !R
override def trigger = allRequirements override def trigger = allRequirements
} }
// This is an opt-in plugin with a requirement // This is an opt-in plugin with a requirement
// Unless explicitly loaded by the build user, this will not be activated. // Unless explicitly loaded by the build user, this will not be activated.
object T extends AutoPlugin object T extends AutoPlugin {
{
override def requires = Q && !R override def requires = Q && !R
} }
// This is an opt-in plugin with a requirement // This is an opt-in plugin with a requirement
// Unless explicitly loaded by the build user, this will not be activated. // Unless explicitly loaded by the build user, this will not be activated.
object U extends AutoPlugin object U extends AutoPlugin {
{
override def requires = A && !Q override def requires = A && !Q
} }
} }

View File

@ -13,7 +13,8 @@ class CommentedXmlSpec extends CheckIfParsedSpec {
| |
|val tra = "</scm>" |val tra = "</scm>"
| |
""".stripMargin, "Xml in string", false, true), """.stripMargin, "Xml in string", false, true
),
(""" ("""
|val scmpom = taskKey[xml.NodeBuffer]("Node buffer") |val scmpom = taskKey[xml.NodeBuffer]("Node buffer")
| |

View File

@ -139,7 +139,8 @@ class EmbeddedXmlSpec extends CheckIfParsedSpec {
| |
| |
| |
""".stripMargin, "xml with blank line", false, true) """.stripMargin, "xml with blank line", false, true
)
) )
} }

View File

@ -36,7 +36,8 @@ lazy val root = (project in file(".")).enablePlugins­(PlayScala)""")
"""import foo.Bar """import foo.Bar
import foo.Bar import foo.Bar
version := "1.0" version := "1.0"
""".stripMargin) """.stripMargin
)
imports.size === 2 imports.size === 2
settingsAndDefs.size === 1 settingsAndDefs.size === 1
} }

View File

@ -9,13 +9,18 @@ object Formatting {
val scalariformCheck = taskKey[Unit]("Checks that the existing code is formatted, via git diff") val scalariformCheck = taskKey[Unit]("Checks that the existing code is formatted, via git diff")
lazy val settings: Seq[Setting[_]] = Seq() ++ scalariformSettings ++ prefs
lazy val prefs: Seq[Setting[_]] = { lazy val prefs: Seq[Setting[_]] = {
import scalariform.formatter.preferences._ import scalariform.formatter.preferences._
Seq( Seq(
scalariformPreferences ~= (_.setPreference(AlignSingleLineCaseStatements, true)) scalariformPreferences ~= (_
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(AlignSingleLineCaseStatements.MaxArrowIndent, 100)
.setPreference(DanglingCloseParenthesis, Force)
)
) )
} }
lazy val settings: Seq[Setting[_]] = Seq() ++ scalariformSettings ++ prefs
lazy val sbtFilesSettings: Seq[Setting[_]] = Seq() ++ scalariformSettings ++ prefs ++ lazy val sbtFilesSettings: Seq[Setting[_]] = Seq() ++ scalariformSettings ++ prefs ++
inConfig(BuildConfig)(configScalariformSettings) ++ inConfig(BuildConfig)(configScalariformSettings) ++
inConfig(BuildSbtConfig)(configScalariformSettings) ++ inConfig(BuildSbtConfig)(configScalariformSettings) ++

View File

@ -5,6 +5,6 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.8")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")
addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0") addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0") // 1.6.0 is out but is a hard upgrade addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.2") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.2")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")

View File

@ -178,7 +178,6 @@ trait Import {
val ~> = sbt.internal.util.~> val ~> = sbt.internal.util.~>
type ~>[-K[_], +V[_]] = sbt.internal.util.~>[K, V] type ~>[-K[_], +V[_]] = sbt.internal.util.~>[K, V]
// sbt.internal.util.complete // sbt.internal.util.complete
object complete { object complete {
val Completion = sbt.internal.util.complete.Completion val Completion = sbt.internal.util.complete.Completion
@ -302,7 +301,6 @@ trait Import {
type VersionNumber = sbt.librarymanagement.VersionNumber type VersionNumber = sbt.librarymanagement.VersionNumber
type VersionNumberCompatibility = sbt.librarymanagement.VersionNumberCompatibility type VersionNumberCompatibility = sbt.librarymanagement.VersionNumberCompatibility
// sbt.internal.librarymanagement // sbt.internal.librarymanagement
type IvyPaths = sbt.internal.librarymanagement.IvyPaths type IvyPaths = sbt.internal.librarymanagement.IvyPaths
val UpdateLogging = sbt.internal.librarymanagement.UpdateLogging val UpdateLogging = sbt.internal.librarymanagement.UpdateLogging

View File

@ -85,7 +85,8 @@ object ScriptedPlugin extends AutoPlugin {
try { try {
scriptedRun.value.invoke( scriptedRun.value.invoke(
scriptedTests.value, sbtTestDirectory.value, scriptedBufferLog.value: java.lang.Boolean, scriptedTests.value, sbtTestDirectory.value, scriptedBufferLog.value: java.lang.Boolean,
args.toArray, sbtLauncher.value, scriptedLaunchOpts.value.toArray) args.toArray, sbtLauncher.value, scriptedLaunchOpts.value.toArray
)
} catch { case e: java.lang.reflect.InvocationTargetException => throw e.getCause } } catch { case e: java.lang.reflect.InvocationTargetException => throw e.getCause }
} }

View File

@ -4,8 +4,20 @@
package sbt package sbt
package std package std
import java.io.{ BufferedInputStream, BufferedOutputStream, BufferedReader, BufferedWriter, Closeable, File, import java.io.{
FileInputStream, FileOutputStream, IOException, InputStreamReader, OutputStreamWriter, PrintWriter } BufferedInputStream,
BufferedOutputStream,
BufferedReader,
BufferedWriter,
Closeable,
File,
FileInputStream,
FileOutputStream,
IOException,
InputStreamReader,
OutputStreamWriter,
PrintWriter
}
import sbt.internal.io.DeferredWriter import sbt.internal.io.DeferredWriter
import sbt.io.IO import sbt.io.IO

View File

@ -29,8 +29,7 @@ object CompletionService {
() => future.get() () => future.get()
} }
def manage[A, T](service: CompletionService[A, T])(setup: A => Unit, cleanup: A => Unit): CompletionService[A, T] = def manage[A, T](service: CompletionService[A, T])(setup: A => Unit, cleanup: A => Unit): CompletionService[A, T] =
wrap(service) { (node, work) => wrap(service) { (node, work) => () =>
() =>
setup(node) setup(node)
try { work() } try { work() }
finally { cleanup(node) } finally { cleanup(node) }

View File

@ -179,7 +179,9 @@ private[sbt] final class Execute[A[_] <: AnyRef](config: Config, triggers: Trigg
val v = register(node) val v = register(node)
val deps = dependencies(v) ++ runBefore(node) val deps = dependencies(v) ++ runBefore(node)
val active = IDSet[A[_]](deps filter notDone) val active = IDSet[A[_]](deps filter notDone)
progressState = progress.registered(progressState, node, deps, active.toList /** active is mutable, so take a snapshot */ ) progressState = progress.registered(progressState, node, deps, active.toList
/** active is mutable, so take a snapshot */
)
if (active.isEmpty) if (active.isEmpty)
ready(node) ready(node)

View File

@ -127,12 +127,14 @@ object TestFramework {
case _ => f.toString case _ => f.toString
} }
def testTasks(frameworks: Map[TestFramework, Framework], def testTasks(
frameworks: Map[TestFramework, Framework],
runners: Map[TestFramework, Runner], runners: Map[TestFramework, Runner],
testLoader: ClassLoader, testLoader: ClassLoader,
tests: Seq[TestDefinition], tests: Seq[TestDefinition],
log: Logger, log: Logger,
listeners: Seq[TestReportListener]): (() => Unit, Seq[(String, TestFunction)], TestResult.Value => () => Unit) = listeners: Seq[TestReportListener]
): (() => Unit, Seq[(String, TestFunction)], TestResult.Value => () => Unit) =
{ {
val mappedTests = testMap(frameworks.values.toSeq, tests) val mappedTests = testMap(frameworks.values.toSeq, tests)
if (mappedTests.isEmpty) if (mappedTests.isEmpty)

View File

@ -37,7 +37,8 @@ trait TestsListener extends TestReportListener {
final class SuiteResult( final class SuiteResult(
val result: TestResult.Value, val result: TestResult.Value,
val passedCount: Int, val failureCount: Int, val errorCount: Int, val passedCount: Int, val failureCount: Int, val errorCount: Int,
val skippedCount: Int, val ignoredCount: Int, val canceledCount: Int, val pendingCount: Int) { val skippedCount: Int, val ignoredCount: Int, val canceledCount: Int, val pendingCount: Int
) {
def +(other: SuiteResult): SuiteResult = { def +(other: SuiteResult): SuiteResult = {
val combinedTestResult = val combinedTestResult =
(result, other.result) match { (result, other.result) match {