From 56aa46308b1613c49ee01f59310ac560b1d6359c Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Mon, 23 Dec 2019 21:06:41 +0000 Subject: [PATCH 1/2] Revert "clarify message on sbt.version mismatch" This reverts commit 2f4b6f476a8084da7332bea720d1f24d84915f32. --- main/src/main/scala/sbt/Main.scala | 4 ++-- sbt/src/sbt-test/project/sbt-version-change/build.sbt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/main/scala/sbt/Main.scala b/main/src/main/scala/sbt/Main.scala index 07cfbec51..d570e6bba 100644 --- a/main/src/main/scala/sbt/Main.scala +++ b/main/src/main/scala/sbt/Main.scala @@ -827,8 +827,8 @@ object BuiltinCommands { sbtVersionOpt.foreach( version => if (version != app.id.version()) { - state.log.warn(s"""sbt version mismatch, using: ${app.id - .version()}, in build.properties: "$version".""") + state.log.warn(s"""sbt version mismatch, current: ${app.id + .version()}, in build.properties: "$version", use 'reboot' to use the new value.""") } ) } diff --git a/sbt/src/sbt-test/project/sbt-version-change/build.sbt b/sbt/src/sbt-test/project/sbt-version-change/build.sbt index 6d9dc4e80..8bc0b3ddf 100644 --- a/sbt/src/sbt-test/project/sbt-version-change/build.sbt +++ b/sbt/src/sbt-test/project/sbt-version-change/build.sbt @@ -3,6 +3,6 @@ TaskKey[Unit]("checkSbtVersionWarning") := { val logging = state.globalLogging val currVersion = state.configuration.provider.id.version() val contents = IO.read(logging.backing.file) - assert(contents.contains(s"""sbt version mismatch, using: $currVersion, in build.properties: "1.1.1".""")) + assert(contents.contains(s"""sbt version mismatch, current: $currVersion, in build.properties: "1.1.1", use 'reboot' to use the new value.""")) () } \ No newline at end of file From f5e73b610a61cc6cf1115b48a5e025c3c325148b Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Mon, 23 Dec 2019 22:24:49 +0000 Subject: [PATCH 2/2] Keep "using" change in sbt.version mismatch messaging. --- main/src/main/scala/sbt/Main.scala | 17 +++++++++-------- .../project/sbt-version-change/build.sbt | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/main/src/main/scala/sbt/Main.scala b/main/src/main/scala/sbt/Main.scala index d570e6bba..5b70bd83f 100644 --- a/main/src/main/scala/sbt/Main.scala +++ b/main/src/main/scala/sbt/Main.scala @@ -823,14 +823,15 @@ object BuiltinCommands { val sbtVersionOpt = sbtVersionSystemOpt.orElse(sbtVersionBuildOpt) - val app = state.configuration.provider - sbtVersionOpt.foreach( - version => - if (version != app.id.version()) { - state.log.warn(s"""sbt version mismatch, current: ${app.id - .version()}, in build.properties: "$version", use 'reboot' to use the new value.""") - } - ) + sbtVersionOpt.foreach { version => + val appVersion = state.configuration.provider.id.version() + if (version != appVersion) { + state.log.warn( + s"sbt version mismatch, using: $appVersion, " + + s"""in build.properties: "$version", use 'reboot' to use the new value.""".stripMargin + ) + } + } } def doLoadProject(s0: State, action: LoadAction.Value): State = { diff --git a/sbt/src/sbt-test/project/sbt-version-change/build.sbt b/sbt/src/sbt-test/project/sbt-version-change/build.sbt index 8bc0b3ddf..f0dbd39a1 100644 --- a/sbt/src/sbt-test/project/sbt-version-change/build.sbt +++ b/sbt/src/sbt-test/project/sbt-version-change/build.sbt @@ -3,6 +3,6 @@ TaskKey[Unit]("checkSbtVersionWarning") := { val logging = state.globalLogging val currVersion = state.configuration.provider.id.version() val contents = IO.read(logging.backing.file) - assert(contents.contains(s"""sbt version mismatch, current: $currVersion, in build.properties: "1.1.1", use 'reboot' to use the new value.""")) + assert(contents.contains(s"""sbt version mismatch, using: $currVersion, in build.properties: "1.1.1", use 'reboot' to use the new value.""")) () -} \ No newline at end of file +}