Merge pull request #4124 from eed3si9n/wip/remove-deprecated

Remove deprecated commands -, --, and ---
This commit is contained in:
eugene yokota 2018-04-26 12:24:32 -04:00 committed by GitHub
commit 812da7abe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 39 deletions

View File

@ -428,6 +428,11 @@ lazy val commandProj = (project in file("main-command"))
contrabandFormatsForType in generateContrabands in Compile := ContrabandConfig.getFormats,
mimaSettings,
mimaBinaryIssueFilters ++= Vector(
// dropped private[sbt] method
exclude[DirectMissingMethodProblem]("sbt.BasicCommands.compatCommands"),
// dropped mainly internal command strings holder
exclude[MissingClassProblem]("sbt.BasicCommandStrings$Compat$"),
exclude[DirectMissingMethodProblem]("sbt.BasicCommands.rebootOptionParser"),
// Changed the signature of Server method. nacho cheese.
exclude[DirectMissingMethodProblem]("sbt.internal.server.Server.*"),

View File

@ -187,20 +187,6 @@ $AliasCommand name=
def StashOnFailure = "sbtStashOnFailure"
def PopOnFailure = "sbtPopOnFailure"
// commands with poor choices for names since they clash with the usual conventions for command line options
// these are not documented and are mainly internal commands and can be removed without a full deprecation cycle
object Compat {
def OnFailure = "-"
def ClearOnFailure = "--"
def FailureWall = "---"
def OnFailureDeprecated = deprecatedAlias(OnFailure, BasicCommandStrings.OnFailure)
def ClearOnFailureDeprecated =
deprecatedAlias(ClearOnFailure, BasicCommandStrings.ClearOnFailure)
def FailureWallDeprecated = deprecatedAlias(FailureWall, BasicCommandStrings.FailureWall)
private[this] def deprecatedAlias(oldName: String, newName: String): String =
s"The `$oldName` command is deprecated in favor of `$newName` and will be removed in a later version"
}
def FailureWall = "resumeFromFailure"
def ClearOnFailure = "sbtClearOnFailure"

View File

@ -56,7 +56,7 @@ object BasicCommands {
client,
read,
alias
) ++ compatCommands
)
def nop: Command = Command.custom(s => success(() => s))
def ignore: Command = Command.command(FailureWall)(idFun)
@ -152,25 +152,6 @@ object BasicCommands {
(s, arg) => s.copy(onFailure = Some(Exec(arg, s.source)))
)
private[sbt] def compatCommands = Seq(
Command.command(Compat.ClearOnFailure) { s =>
s.log.warn(Compat.ClearOnFailureDeprecated)
s.copy(onFailure = None)
},
Command.arb(
s =>
token(Compat.OnFailure, hide = const(true))
.flatMap(_ => otherCommandParser(s))
) { (s, arg) =>
s.log.warn(Compat.OnFailureDeprecated)
s.copy(onFailure = Some(Exec(arg, s.source)))
},
Command.command(Compat.FailureWall) { s =>
s.log.warn(Compat.FailureWallDeprecated)
s
}
)
def clearOnFailure: Command = Command.command(ClearOnFailure)(s => s.copy(onFailure = None))
def stashOnFailure: Command =

View File

@ -285,11 +285,7 @@ object State {
def log = s.globalLogging.full
def handleError(t: Throwable): State = handleException(t, s, log)
def fail = {
import BasicCommandStrings.Compat.{ FailureWall => CompatFailureWall }
val remaining =
s.remainingCommands.dropWhile(
c => c.commandLine != FailureWall && c.commandLine != CompatFailureWall
)
val remaining = s.remainingCommands.dropWhile(c => c.commandLine != FailureWall)
if (remaining.isEmpty)
applyOnFailure(s, Nil, exit(ok = false))
else