mirror of https://github.com/sbt/sbt.git
Fix Scala 3 binary version
- for 3.0.1-bin-nonbootstrapped it should be 3 - for 3.0.1-SNAPSHOT it should be 3
This commit is contained in:
parent
40a2166318
commit
37234e35ba
|
|
@ -76,11 +76,12 @@ object CrossVersionUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
private[sbt] def binaryScala3Version(full: String): String = full match {
|
private[sbt] def binaryScala3Version(full: String): String = full match {
|
||||||
case ReleaseV(maj, _, _, _) => maj
|
case ReleaseV(maj, _, _, _) => maj
|
||||||
case CandidateV(maj, min, patch, _) if min.toLong > 0 || patch.toLong > 0 => maj
|
case NonReleaseV_n(maj, min, patch, _) if min.toLong > 0 || patch.toLong > 0 => maj
|
||||||
case MilestonV(maj, min, patch, _) if min.toLong > 0 || patch.toLong > 0 => maj
|
case BinCompatV(maj, min, patch, stageOrNull, _) =>
|
||||||
case BinCompatV(maj, min, patch, stage, _) => binaryScala3Version(s"$maj.$min.$patch$stage")
|
val stage = if (stageOrNull != null) stageOrNull else ""
|
||||||
case _ => full
|
binaryScala3Version(s"$maj.$min.$patch$stage")
|
||||||
|
case _ => full
|
||||||
}
|
}
|
||||||
|
|
||||||
def binaryScalaVersion(full: String): String = {
|
def binaryScalaVersion(full: String): String = {
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,13 @@ class CrossVersionTest extends UnitSpec {
|
||||||
binaryScalaVersion("3.0.1-M1") shouldBe "3"
|
binaryScalaVersion("3.0.1-M1") shouldBe "3"
|
||||||
}
|
}
|
||||||
it should "for 3.0.1-RC1-bin-SNAPSHOT return 3" in {
|
it should "for 3.0.1-RC1-bin-SNAPSHOT return 3" in {
|
||||||
binaryScalaVersion("3.0.1-RC1") shouldBe "3"
|
binaryScalaVersion("3.0.1-RC1-bin-SNAPSHOT") shouldBe "3"
|
||||||
|
}
|
||||||
|
it should "for 3.0.1-bin-nonbootstrapped return 3" in {
|
||||||
|
binaryScalaVersion("3.0.1-bin-SNAPSHOT") shouldBe "3"
|
||||||
|
}
|
||||||
|
it should "for 3.0.1-SNAPSHOT return 3" in {
|
||||||
|
binaryScalaVersion("3.0.1-SNAPSHOT") shouldBe "3"
|
||||||
}
|
}
|
||||||
|
|
||||||
private def patchVersion(fullVersion: String) =
|
private def patchVersion(fullVersion: String) =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue