Skip to content

Commit

Permalink
bugfix: Never set empty Scala JS version from sbt
Browse files Browse the repository at this point in the history
PReviously, we were always expecting scala JS plugin to find the correct version of Scala JS, however I think for Scala 3 it's not a plugin, which is causing the version field to be empty. Now, we look for the scala-js library instead and default to the latest known scala js version.
  • Loading branch information
tgodzik committed Sep 19, 2023
1 parent 35ffb18 commit 008ebfb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ val integrations = file("integrations")
lazy val sbtBloop: Project = project
.enablePlugins(ScriptedPlugin)
.disablePlugins(ScalafixPlugin)
.enablePlugins(BuildInfoPlugin)
.in(integrations / "sbt-bloop")
.settings(
scriptedBufferLog := false,
Expand All @@ -347,7 +348,11 @@ lazy val sbtBloop: Project = project
sbtPlugin := true,
sbtVersion := SbtVersion,
target := (file("integrations") / "sbt-bloop" / "target" / SbtVersion).getAbsoluteFile,
libraryDependencies += Dependencies.bloopConfig
libraryDependencies += Dependencies.bloopConfig,
buildInfoPackage := "bloop.integrations.sbt",
buildInfoKeys := List[BuildInfoKey](
"latestScalaJsVersion" -> Dependencies.scalaJs1Version
)
)

lazy val buildpressConfig = (project in file("buildpress-config"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,12 @@ object BloopDefaults {
}
} else if (pluginLabels.contains(ScalaJsPluginLabel)) {
Def.task {
val emptyScalaJs = Config.JsConfig.empty
val scalaJsVersion = findVersion(libraryDeps, "org.scala-js").getOrElse(emptyScalaJs.version)
val emptyScalaJs = Config.JsConfig.empty
val scalaJsVersion = libraryDeps
.find(module => module.organization == "org.scala-js" && module.name.startsWith("scalajs-library_"))
.map(_.revision)
.getOrElse(BuildInfo.latestScalaJsVersion)

val scalaJsStage = BloopKeys.bloopScalaJSStage.value match {
case Some(ScalaJsFastOpt) => Config.LinkerMode.Debug
case Some(ScalaJsFullOpt) => Config.LinkerMode.Release
Expand Down

0 comments on commit 008ebfb

Please sign in to comment.