From 6676e4ec22969305fa10a1d2a7216cbabc3cf233 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 8 Jul 2022 15:36:43 -0700 Subject: [PATCH] wip --- build.sbt | 4 ++-- project/Version.scala | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build.sbt b/build.sbt index e6f183e0..072154d7 100644 --- a/build.sbt +++ b/build.sbt @@ -372,7 +372,7 @@ inThisBuild { val platformSuffix = if (isScalaJs) "JS" else if (isScalaNative) "Native" else "" - val compatProject = "compat" + ciScalaVersion.get.binary + platformSuffix + val compatProject = s"compat${ciScalaVersion.get}$platformSuffix" val binaryCompatProject = "binaryCompat" val testProjectPrefix = @@ -394,7 +394,7 @@ inThisBuild { } Seq( - List(s"""++${sys.env.get("CI_SCALA_VERSION").get}!"""), + List(s"""++${sys.env.get("CI_SCALA_VERSION").get}"""), List(s"$projectPrefix/clean"), List(s"$testProjectPrefix/test"), List(s"$projectPrefix/publishLocal"), diff --git a/project/Version.scala b/project/Version.scala index 80cf368d..e5c2521a 100644 --- a/project/Version.scala +++ b/project/Version.scala @@ -1,24 +1,24 @@ -case class Version(major: Int, minor: Int, patch: Int) { - def binary: String = s"${major}${minor}" - override def toString: String = s"${major}.${minor}.${patch}" +case class Version(major: Int, minor: Int) { + override def toString = s"${major}${minor}" } object Version { - // the (#.+)? part allows republishing for a new Scala version - private val versionRegex0 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:#.+)?".r - private val versionRegex1 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)-(.+)(?:#.+)?".r + // `(#.+)?` allows republishing for a new Scala version + // `|x` allows the sbt 1.7 style ".x" versions + private val versionRegex0 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+|x)(?:#.+)?".r + private val versionRegex1 = "v?([0-9]+)\\.([0-9]+)\\.([0-9]+|x)-(.+)(?:#.+)?".r private val versionRegex2 = "([0-9]+)\\.([0-9]+)(?:#.+)?".r private val versionRegex3 = "([0-9]+)(?:#.+)?".r def parse(raw: String): Option[Version] = { raw match { - case versionRegex0(major, minor, patch) => - Some(Version(major.toInt, minor.toInt, patch.toInt)) - case versionRegex1(major, minor, patch, _) => - Some(Version(major.toInt, minor.toInt, patch.toInt)) + case versionRegex0(major, minor, _) => + Some(Version(major.toInt, minor.toInt)) + case versionRegex1(major, minor, _, _) => + Some(Version(major.toInt, minor.toInt)) case versionRegex2(major, minor) => - Some(Version(major.toInt, minor.toInt, 0)) + Some(Version(major.toInt, minor.toInt)) case versionRegex3(major) => - Some(Version(major.toInt, 0, 0)) + Some(Version(major.toInt, 0)) case _ => None }