From d90f2734207acfd4dd0b8f3e86e0bf986673916a Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Thu, 26 Apr 2018 05:02:21 -0400 Subject: [PATCH 1/2] Remove deprecated commands -, --, and --- https://github.com/sbt/sbt/commit/86ae3c8c59df546dadb8c62901bac50c175af78a deprecated -, --, and ---. This removes the deprecated commands. --- main-command/src/main/scala/sbt/BasicCommands.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main-command/src/main/scala/sbt/BasicCommands.scala b/main-command/src/main/scala/sbt/BasicCommands.scala index e9d5b8a19..38e7fb663 100644 --- a/main-command/src/main/scala/sbt/BasicCommands.scala +++ b/main-command/src/main/scala/sbt/BasicCommands.scala @@ -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) From 3a4bc8dc0ba833a6d093b9bdb9b39494ab17d055 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Thu, 26 Apr 2018 14:03:35 +0100 Subject: [PATCH 2/2] Dropped deprecated "compat" commands & strings Fixes #4089 --- build.sbt | 5 +++++ .../main/scala/sbt/BasicCommandStrings.scala | 14 -------------- .../src/main/scala/sbt/BasicCommands.scala | 19 ------------------- main-command/src/main/scala/sbt/State.scala | 6 +----- 4 files changed, 6 insertions(+), 38 deletions(-) diff --git a/build.sbt b/build.sbt index 1c24cf775..39fa79c84 100644 --- a/build.sbt +++ b/build.sbt @@ -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.*"), diff --git a/main-command/src/main/scala/sbt/BasicCommandStrings.scala b/main-command/src/main/scala/sbt/BasicCommandStrings.scala index 6baee9509..b819f77a5 100644 --- a/main-command/src/main/scala/sbt/BasicCommandStrings.scala +++ b/main-command/src/main/scala/sbt/BasicCommandStrings.scala @@ -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" diff --git a/main-command/src/main/scala/sbt/BasicCommands.scala b/main-command/src/main/scala/sbt/BasicCommands.scala index 38e7fb663..439821a6d 100644 --- a/main-command/src/main/scala/sbt/BasicCommands.scala +++ b/main-command/src/main/scala/sbt/BasicCommands.scala @@ -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 = diff --git a/main-command/src/main/scala/sbt/State.scala b/main-command/src/main/scala/sbt/State.scala index e65e58a03..f79b9d70d 100644 --- a/main-command/src/main/scala/sbt/State.scala +++ b/main-command/src/main/scala/sbt/State.scala @@ -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