Skip to content

Commit

Permalink
Add scala 3.3.2 and 3.4.0 (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
rochala authored Feb 14, 2024
1 parent ae5e999 commit d1cccb6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.olegych.scastie.buildinfo.BuildInfo
object ScalaVersions {
def suggestedScalaVersions(tpe: ScalaTargetType): List[String] = {
val versions = tpe match {
case ScalaTargetType.Scala3 => List(BuildInfo.stableLTS, BuildInfo.latestLTS, BuildInfo.latestNext)
case ScalaTargetType.JS => List(BuildInfo.stableLTS, BuildInfo.latest213, BuildInfo.latest212)
case ScalaTargetType.Scala3 => List(BuildInfo.stableLTS, BuildInfo.stableNext)
case ScalaTargetType.JS => List(BuildInfo.stableLTS, BuildInfo.stableNext, BuildInfo.latest213, BuildInfo.latest212)
case _ => List(BuildInfo.latest213, BuildInfo.latest212)
}
versions.distinct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.olegych.scastie.api._
import japgolly.scalajs.react._

import vdom.all._
import com.olegych.scastie.buildinfo.BuildInfo

case class VersionSelector(scalaTarget: ScalaTarget, onChange: ScalaTarget ~=> Callback) {
@inline def render: VdomElement = VersionSelector.versionSelectorHook(this)
Expand All @@ -24,6 +25,12 @@ object VersionSelector {
case n: ScalaTarget.Native => ScalaTarget.Native(n.scalaNativeVersion, n.scalaVersion)
}

def renderRecommended3Versions(scalaVersion: String) = {
if (scalaVersion == BuildInfo.stableLTS) s"$scalaVersion LTS"
else if (scalaVersion == BuildInfo.stableNext) s"$scalaVersion Next"
else scalaVersion
}

ul(cls := "suggestedVersions")(
ScalaVersions
.suggestedScalaVersions(props.scalaTarget.targetType)
Expand All @@ -37,7 +44,7 @@ object VersionSelector {
onChange --> props.onChange(versionSelectors(suggestedVersion)),
checked := props.scalaTarget.scalaVersion == suggestedVersion
),
label(`for` := s"scala-$suggestedVersion", cls := "radio", role := "button", suggestedVersion)
label(`for` := s"scala-$suggestedVersion", cls := "radio", role := "button", renderRecommended3Versions(suggestedVersion))
)
}
.toTagMod,
Expand Down
10 changes: 5 additions & 5 deletions project/SbtShared.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ object SbtShared {
val latest212 = "2.12.18"
val latest213 = "2.13.12"
val old3 = "3.0.2"
val stableLTS = "3.3.1"
val stableNext = "???"
val latestLTS = "3.3.2-RC3"
val latestNext = "3.4.0-RC4"
val stableLTS = "3.3.2"
val stableNext = "3.4.0"
val latestLTS = "3.3.2"
val latestNext = "3.4.1-RC1"
val js = latest213
val sbt = latest212
val jvm = latest213
Expand Down Expand Up @@ -152,7 +152,7 @@ object SbtShared {
"latest212" -> ScalaVersions.latest212,
"latest213" -> ScalaVersions.latest213,
"stableLTS" -> ScalaVersions.stableLTS,
// "stableNext" -> ScalaVersions.stableNext,
"stableNext" -> ScalaVersions.stableNext,
"latestLTS" -> ScalaVersions.latestLTS,
"latestNext" -> ScalaVersions.latestNext,
"jsScalaVersion" -> ScalaVersions.js,
Expand Down

0 comments on commit d1cccb6

Please sign in to comment.