Skip to content

Commit

Permalink
Change to read scala.js and native plugin versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vlovgr committed Oct 6, 2023
1 parent 2b5c8af commit 2c148cb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@ val scala213 = "2.13.12"

val scala3 = "3.3.1"

val scalaJsMajorMinorVersion = "1.14"

val scalaNativeMajorMinorVersion = "0.4"
val scalaJsMajorMinorVersion =
""""org.scala-js" % "sbt-scalajs" % "([^"]+)"""".r
.findFirstMatchIn(IO.read(file("project/plugins.sbt")))
.map(_.group(1))
.flatMap(CrossVersion.partialVersion)
.map { case (major, minor) => s"$major.$minor" }
.getOrElse(throw new MessageOnlyException("Unable to determine Scala.js plugin version."))

val scalaNativeMajorMinorVersion =
""""org.scala-native" % "sbt-scala-native" % "([^"]+)"""".r
.findFirstMatchIn(IO.read(file("project/plugins.sbt")))
.map(_.group(1))
.flatMap(CrossVersion.partialVersion)
.map { case (major, minor) => s"$major.$minor" }
.getOrElse(throw new MessageOnlyException("Unable to determine Scala Native plugin version."))

ThisBuild / versionScheme := Some("early-semver")

Expand Down

0 comments on commit 2c148cb

Please sign in to comment.