From b7c9862f163931d04a574ea7bc93c4e7dbfe3c42 Mon Sep 17 00:00:00 2001 From: tiqwab Date: Tue, 15 May 2018 23:09:43 +0900 Subject: [PATCH 1/2] Fix kebab-case commands: notify-users-about-shell, write-sbt-version --- main/src/main/scala/sbt/Main.scala | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/main/src/main/scala/sbt/Main.scala b/main/src/main/scala/sbt/Main.scala index 2117f26f0..b7c61ccb7 100644 --- a/main/src/main/scala/sbt/Main.scala +++ b/main/src/main/scala/sbt/Main.scala @@ -197,7 +197,9 @@ object BuiltinCommands { plugin, plugins, writeSbtVersion, + oldWriteSbtVersion, notifyUsersAboutShell, + oldNotifyUsersAboutShell, shell, startServer, eval, @@ -853,12 +855,19 @@ object BuiltinCommands { if (!java.lang.Boolean.getBoolean("sbt.skip.version.write") && !intendsToInvokeNew(state)) writeSbtVersionUnconditionally(state) - private def WriteSbtVersion = "write-sbt-version" + private def WriteSbtVersion = "writeSbtVersion" + private def OldWriteSbtVersion = "write-sbt-version" private def writeSbtVersion: Command = Command.command(WriteSbtVersion) { state => writeSbtVersion(state); state } + @deprecated("Use `writeSbtVersion` instead", "1.2.0") + private def oldWriteSbtVersion: Command = + Command.command(OldWriteSbtVersion) { state => + state.log.warn(deprecationWarningText(OldWriteSbtVersion, WriteSbtVersion)) + writeSbtVersion(state); state + } private def intendsToInvokeCompile(state: State) = state.remainingCommands exists (_.commandLine == Keys.compile.key.label) @@ -869,10 +878,17 @@ object BuiltinCommands { state.log info "Executing in batch mode. For better performance use sbt's shell" } - private def NotifyUsersAboutShell = "notify-users-about-shell" + private def NotifyUsersAboutShell = "notifyUsersAboutShell" + private def OldNotifyUsersAboutShell = "notify-users-about-shell" private def notifyUsersAboutShell: Command = Command.command(NotifyUsersAboutShell) { state => notifyUsersAboutShell(state); state } + @deprecated("Use `notifyUsersAboutShell` instead", "1.2.0") + private def oldNotifyUsersAboutShell: Command = + Command.command(OldNotifyUsersAboutShell) { state => + state.log.warn(deprecationWarningText(OldNotifyUsersAboutShell, NotifyUsersAboutShell)) + notifyUsersAboutShell(state); state + } } From ab35c21c9818d9effe38fd3682ba4c6d59df4862 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Mon, 21 May 2018 17:24:38 +0100 Subject: [PATCH 2/2] Drop deprecated write-sbt-version & notify-users-about-shell Introduced in https://github.com/sbt/sbt/pull/4169, these commands aren't "user-facing" and are quite new. So no need to keep the old kebab syntax. --- main/src/main/scala/sbt/Main.scala | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/main/src/main/scala/sbt/Main.scala b/main/src/main/scala/sbt/Main.scala index b7c61ccb7..b29cca948 100644 --- a/main/src/main/scala/sbt/Main.scala +++ b/main/src/main/scala/sbt/Main.scala @@ -197,9 +197,7 @@ object BuiltinCommands { plugin, plugins, writeSbtVersion, - oldWriteSbtVersion, notifyUsersAboutShell, - oldNotifyUsersAboutShell, shell, startServer, eval, @@ -856,18 +854,11 @@ object BuiltinCommands { writeSbtVersionUnconditionally(state) private def WriteSbtVersion = "writeSbtVersion" - private def OldWriteSbtVersion = "write-sbt-version" private def writeSbtVersion: Command = Command.command(WriteSbtVersion) { state => writeSbtVersion(state); state } - @deprecated("Use `writeSbtVersion` instead", "1.2.0") - private def oldWriteSbtVersion: Command = - Command.command(OldWriteSbtVersion) { state => - state.log.warn(deprecationWarningText(OldWriteSbtVersion, WriteSbtVersion)) - writeSbtVersion(state); state - } private def intendsToInvokeCompile(state: State) = state.remainingCommands exists (_.commandLine == Keys.compile.key.label) @@ -879,16 +870,9 @@ object BuiltinCommands { } private def NotifyUsersAboutShell = "notifyUsersAboutShell" - private def OldNotifyUsersAboutShell = "notify-users-about-shell" private def notifyUsersAboutShell: Command = Command.command(NotifyUsersAboutShell) { state => notifyUsersAboutShell(state); state } - @deprecated("Use `notifyUsersAboutShell` instead", "1.2.0") - private def oldNotifyUsersAboutShell: Command = - Command.command(OldNotifyUsersAboutShell) { state => - state.log.warn(deprecationWarningText(OldNotifyUsersAboutShell, NotifyUsersAboutShell)) - notifyUsersAboutShell(state); state - } }