From b98bc3eeeed3eaf5e3833a8c9af4ab0acf6997ed Mon Sep 17 00:00:00 2001 From: tarao Date: Mon, 6 Nov 2023 23:10:41 +0900 Subject: [PATCH] Support ScalaJS. --- build.sbt | 15 +++++++++------ project/plugins.sbt | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index e9c7233..9852a90 100644 --- a/build.sbt +++ b/build.sbt @@ -49,25 +49,28 @@ lazy val commonSettings = Def.settings( """ ) -lazy val root = (project in file(".")) +lazy val root = tlCrossRootProject .aggregate(core) .settings(commonSettings) .settings( - console := (core / Compile / console).value, - Test / console := (core / Test / console).value, + console := (core.jvm / Compile / console).value, + Test / console := (core.jvm / Test / console).value, ThisBuild / Test / parallelExecution := false ) -lazy val core = (project in file("modules/core")) +lazy val core = crossProject(JVMPlatform, JSPlatform) + .crossType(CrossType.Pure) + .withoutSuffixFor(JVMPlatform) + .in(file("modules/core")) .settings(commonSettings) .settings( libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.2.17" % Test, + "org.scalatest" %%% "scalatest" % "3.2.17" % Test, ) ) lazy val benchmark_3 = (project in file("modules/benchmark_3")) - .dependsOn(core) + .dependsOn(core.jvm) .settings(commonSettings) .enablePlugins(JmhPlugin) .enablePlugins(NoPublishPlugin) diff --git a/project/plugins.sbt b/project/plugins.sbt index 97244f7..b8a72e2 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,3 @@ addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6") addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.6.1") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0")