Skip to content

Commit 6676e4e

Browse files
committed
wip
1 parent 331266e commit 6676e4e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ inThisBuild {
372372

373373
val platformSuffix = if (isScalaJs) "JS" else if (isScalaNative) "Native" else ""
374374

375-
val compatProject = "compat" + ciScalaVersion.get.binary + platformSuffix
375+
val compatProject = s"compat${ciScalaVersion.get}$platformSuffix"
376376
val binaryCompatProject = "binaryCompat"
377377

378378
val testProjectPrefix =
@@ -394,7 +394,7 @@ inThisBuild {
394394
}
395395

396396
Seq(
397-
List(s"""++${sys.env.get("CI_SCALA_VERSION").get}!"""),
397+
List(s"""++${sys.env.get("CI_SCALA_VERSION").get}"""),
398398
List(s"$projectPrefix/clean"),
399399
List(s"$testProjectPrefix/test"),
400400
List(s"$projectPrefix/publishLocal"),

project/Version.scala

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
case class Version(major: Int, minor: Int, patch: Int) {
2-
def binary: String = s"${major}${minor}"
3-
override def toString: String = s"${major}.${minor}.${patch}"
1+
case class Version(major: Int, minor: Int) {
2+
override def toString = s"${major}${minor}"
43
}
54

65
object Version {
7-
// the (#.+)? part allows republishing for a new Scala version
8-
private val versionRegex0 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:#.+)?".r
9-
private val versionRegex1 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)-(.+)(?:#.+)?".r
6+
// `(#.+)?` allows republishing for a new Scala version
7+
// `|x` allows the sbt 1.7 style ".x" versions
8+
private val versionRegex0 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+|x)(?:#.+)?".r
9+
private val versionRegex1 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+|x)-(.+)(?:#.+)?".r
1010
private val versionRegex2 = "([0-9]+)\\.([0-9]+)(?:#.+)?".r
1111
private val versionRegex3 = "([0-9]+)(?:#.+)?".r
1212
def parse(raw: String): Option[Version] = {
1313
raw match {
14-
case versionRegex0(major, minor, patch) =>
15-
Some(Version(major.toInt, minor.toInt, patch.toInt))
16-
case versionRegex1(major, minor, patch, _) =>
17-
Some(Version(major.toInt, minor.toInt, patch.toInt))
14+
case versionRegex0(major, minor, _) =>
15+
Some(Version(major.toInt, minor.toInt))
16+
case versionRegex1(major, minor, _, _) =>
17+
Some(Version(major.toInt, minor.toInt))
1818
case versionRegex2(major, minor) =>
19-
Some(Version(major.toInt, minor.toInt, 0))
19+
Some(Version(major.toInt, minor.toInt))
2020
case versionRegex3(major) =>
21-
Some(Version(major.toInt, 0, 0))
21+
Some(Version(major.toInt, 0))
2222
case _ =>
2323
None
2424
}

0 commit comments

Comments
 (0)