mirror of
https://github.com/sbt/sbt.git
synced 2026-08-22 14:17:13 +02:00
Show a more appropriate message when no Scala versions matches
When switching scala versions with a wildcard, and no subproject has a matching version to switch to, show a more appropriate error message
This commit is contained in:
@@ -15,6 +15,7 @@ import sbt.internal.Act
|
|||||||
import sbt.internal.CommandStrings._
|
import sbt.internal.CommandStrings._
|
||||||
import sbt.internal.inc.ScalaInstance
|
import sbt.internal.inc.ScalaInstance
|
||||||
import sbt.internal.util.AttributeKey
|
import sbt.internal.util.AttributeKey
|
||||||
|
import sbt.internal.util.MessageOnlyException
|
||||||
import sbt.internal.util.complete.DefaultParsers._
|
import sbt.internal.util.complete.DefaultParsers._
|
||||||
import sbt.internal.util.complete.{ DefaultParsers, Parser }
|
import sbt.internal.util.complete.{ DefaultParsers, Parser }
|
||||||
import sbt.io.IO
|
import sbt.io.IO
|
||||||
@@ -361,7 +362,12 @@ object Cross {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (included.isEmpty) {
|
if (included.isEmpty) {
|
||||||
sys.error(
|
if (isSelector(version))
|
||||||
|
throw new MessageOnlyException(
|
||||||
|
s"""Switch failed: no subprojects have a version matching "$version" in the crossScalaVersions setting."""
|
||||||
|
)
|
||||||
|
else
|
||||||
|
throw new MessageOnlyException(
|
||||||
s"""Switch failed: no subprojects list "$version" (or compatible version) in crossScalaVersions setting.
|
s"""Switch failed: no subprojects list "$version" (or compatible version) in crossScalaVersions setting.
|
||||||
|If you want to force it regardless, call ++ $version!""".stripMargin
|
|If you want to force it regardless, call ++ $version!""".stripMargin
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user