Merge pull request #1573 from cunei/wip-scala-bin-compat

Allow the "-bin" Scala version suffix to specify a bincompat version
This commit is contained in:
Josh Suereth 2014-09-05 11:34:05 -04:00
commit 448eaff4bd
1 changed files with 2 additions and 0 deletions

View File

@ -39,9 +39,11 @@ object CrossVersionUtil
private[${{cross.package0}}] def scalaApiVersion(v: String): Option[(Int, Int)] =
{
val ReleaseV = """(\d+)\.(\d+)\.(\d+)(-\d+)?""".r
val BinCompatV = """(\d+)\.(\d+)\.(\d+)-bin(-.*)?""".r
val NonReleaseV = """(\d+)\.(\d+)\.(\d+)(-\w+)""".r
v match {
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 _ => None
}