Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danieletorelli committed May 8, 2024
1 parent ba57fc7 commit 588c377
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/main/scala/cloud/golem/GolemScalaPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,15 @@ import sbt.*
import sbt.Keys.*
import org.scalajs.sbtplugin.ScalaJSPlugin
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport.*
import sbt.KeyRanks.BSetting
import sbt.plugins.JvmPlugin

object GolemScalaPlugin extends AutoPlugin {
private object Versions {
val macros = "0.1.0"
val scalaMacrosParadise = "2.1.1"
}

object autoImport {
val outputDirectory =
SettingKey[File](
"outputDirectory",
"Directory for linker output",
BSetting
)

val witBindgen =
taskKey[Unit]("Runs golem-scalajs-wit-bindgen to generate WIT bindings")

Expand Down Expand Up @@ -54,7 +47,22 @@ object GolemScalaPlugin extends AutoPlugin {

override lazy val projectSettings: Seq[Setting[?]] = baseSettings ++ Seq(
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
Compile / fullLinkJS / scalaJSLinkerOutputDirectory := outputDirectory.value,
libraryDependencies += "cloud.golem" %% "golem-scala-macros" % Versions.macros
) ++ macroParadiseSettings

private lazy val macroParadiseSettings = Seq(
scalacOptions ++= {
if (scalaVersion.value.startsWith("2.13")) Seq("-Ymacro-annotations")
else Nil
},
libraryDependencies ++= {
if (scalaVersion.value.startsWith("2.12")) {
Seq(
compilerPlugin(
"org.scalamacros" % "paradise" % Versions.scalaMacrosParadise cross CrossVersion.full
)
)
} else Nil
}
)
}

0 comments on commit 588c377

Please sign in to comment.