mirror of https://github.com/sbt/sbt.git
Show a more useful log message when doing a flexible version switch
Suggested by @SethTisue in https://github.com/sbt/sbt/pull/6894#issuecomment-1168042209 Will show multiple lines when different versions are selected for different subprojects. When no subprojects have a matching Scala version you will get a 'Switch failed' exception anyway, so in that case there is no change in behavior.
This commit is contained in:
parent
498493599f
commit
6a79bdb461
|
|
@ -294,7 +294,14 @@ object Cross {
|
||||||
if (switch.version.force) {
|
if (switch.version.force) {
|
||||||
state.log.info(s"Forcing Scala version to $version on all projects.")
|
state.log.info(s"Forcing Scala version to $version on all projects.")
|
||||||
} else {
|
} else {
|
||||||
state.log.info(s"Setting Scala version to $version on ${included.size} projects.")
|
included
|
||||||
|
.groupBy(_._2)
|
||||||
|
.foreach {
|
||||||
|
case (selectedVersion, projects) =>
|
||||||
|
state.log.info(
|
||||||
|
s"Setting Scala version to $selectedVersion on ${projects.size} projects."
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (excluded.nonEmpty && !switch.verbose) {
|
if (excluded.nonEmpty && !switch.verbose) {
|
||||||
state.log.info(s"Excluded ${excluded.size} projects, run ++ $version -v for more details.")
|
state.log.info(s"Excluded ${excluded.size} projects, run ++ $version -v for more details.")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue