mirror of https://github.com/sbt/sbt.git
Allow the "-bin" Scala version suffix to specify a bincompat version
There is sometimes the need to use a test version of Scala that is intended to be binary compatible with a standard release version. At this time, due to the particular logic implemented within sbt, a non-numeric suffix will never have the same binaryScalaVersion of a release version ending in ".0", like for instance "2.11.0". This commit allows developers to use as suffix any string that begins with "-bin", for instance "2.11.0-bin-compat-test-1". Such a suffix will have a binaryScalaVersion of "2.11", being therefore considered binary compatible with release versions.
This commit is contained in:
parent
ca0665d7f0
commit
751305ab95
|
|
@ -39,9 +39,11 @@ object CrossVersionUtil
|
||||||
private[${{cross.package0}}] def scalaApiVersion(v: String): Option[(Int, Int)] =
|
private[${{cross.package0}}] def scalaApiVersion(v: String): Option[(Int, Int)] =
|
||||||
{
|
{
|
||||||
val ReleaseV = """(\d+)\.(\d+)\.(\d+)(-\d+)?""".r
|
val ReleaseV = """(\d+)\.(\d+)\.(\d+)(-\d+)?""".r
|
||||||
|
val BinCompatV = """(\d+)\.(\d+)\.(\d+)-bin(-.*)?""".r
|
||||||
val NonReleaseV = """(\d+)\.(\d+)\.(\d+)(-\w+)""".r
|
val NonReleaseV = """(\d+)\.(\d+)\.(\d+)(-\w+)""".r
|
||||||
v match {
|
v match {
|
||||||
case ReleaseV(x, y, z, ht) => Some((x.toInt, y.toInt))
|
case ReleaseV(x, y, z, ht) => Some((x.toInt, y.toInt))
|
||||||
|
case BinCompatV(x, y, z, ht) => Some((x.toInt, y.toInt))
|
||||||
case NonReleaseV(x, y, z, ht) if z.toInt > 0 => Some((x.toInt, y.toInt))
|
case NonReleaseV(x, y, z, ht) if z.toInt > 0 => Some((x.toInt, y.toInt))
|
||||||
case _ => None
|
case _ => None
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue