Skip to content

Commit

Permalink
scala3 js
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoon committed Aug 10, 2022
1 parent 144b77c commit 43fa16f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 45 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ jobs:
if: ${{ !startsWith(matrix.scala, '3.') }}
run: ./sbt ++${{ matrix.scala }}! mimaChecks
- name: Run tests
if: ${{ !startsWith(matrix.scala, '3.') }}
run: sbt ++${{ matrix.scala }}! test${{ matrix.platform }}
- name: Run scala3 tests
if: ${{ startsWith(matrix.scala, '3.') && matrix.platform == 'JVM' }}
run: sbt ++${{ matrix.scala }}! testJVM
- name: Compile additional subprojects
if: ${{ startsWith(matrix.scala, '2.12.') || startsWith(matrix.scala, '2.13.') }}
run: sbt ++${{ matrix.scala }}! examples/compile docs/compile benchmarks/compile
Expand Down
4 changes: 0 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
)

lazy val coreJVM = core.jvm
.settings(scala3Settings)
lazy val coreJS = core.js.settings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.4.0" % Test
)
Expand All @@ -80,7 +79,6 @@ lazy val slf4j = project
.in(file("slf4j"))
.dependsOn(coreJVM)
.settings(stdSettings("zio-logging-slf4j"))
.settings(scala3Settings)
.settings(mimaSettings(failOnProblem = true))
.settings(
libraryDependencies ++= Seq(
Expand All @@ -97,7 +95,6 @@ lazy val slf4jBridge = project
.in(file("slf4j-bridge"))
.dependsOn(coreJVM)
.settings(stdSettings("zio-logging-slf4j-bridge"))
.settings(scala3Settings)
.settings(mimaSettings(failOnProblem = true))
.settings(
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -140,7 +137,6 @@ lazy val examples = project
.in(file("examples"))
.dependsOn(slf4j)
.settings(stdSettings("zio-logging-examples"))
.settings(scala3Settings)
.settings(
publish / skip := true,
libraryDependencies ++= Seq(
Expand Down
44 changes: 10 additions & 34 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,38 +66,6 @@ object BuildHelper {
buildInfoPackage := packageName
)

val scala3Settings = Seq(
crossScalaVersions += Scala3,
scalacOptions ++= {
if (scalaVersion.value == Scala3)
Seq("-noindent")
else
Seq()
},
scalacOptions --= {
if (scalaVersion.value == Scala3)
Seq("-Xfatal-warnings")
else
Seq()
},
Compile / doc / sources := {
val old = (Compile / doc / sources).value
if (scalaVersion.value == Scala3) {
Nil
} else {
old
}
},
Test / parallelExecution := {
val old = (Test / parallelExecution).value
if (scalaVersion.value == Scala3) {
false
} else {
old
}
}
)

val scalaReflectSettings = Seq(
libraryDependencies ++= Seq("dev.zio" %%% "izumi-reflect" % "2.1.3")
)
Expand Down Expand Up @@ -236,7 +204,7 @@ object BuildHelper {
def stdSettings(prjName: String) =
Seq(
name := s"$prjName",
crossScalaVersions := Seq(Scala211, Scala212, Scala213),
crossScalaVersions := Seq(Scala211, Scala212, Scala213, Scala3),
ThisBuild / scalaVersion := Scala213,
scalacOptions := stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value),
libraryDependencies ++= {
Expand All @@ -258,7 +226,15 @@ object BuildHelper {
"com.github.liancheng" %% "organize-imports" % "0.5.0",
"com.github.vovapolu" %% "scaluzzi" % "0.1.18"
),
Test / parallelExecution := true,
Compile / doc / sources := {
val old = (Compile / doc / sources).value
if (scalaVersion.value == Scala3) {
Nil
} else {
old
}
},
Test / parallelExecution := scalaVersion.value != Scala3,
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.0")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
Expand All @@ -9,9 +9,9 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin"
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.5")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("pl.project13.scala" % "sbt-jcstress" % "0.2.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")
Expand Down

0 comments on commit 43fa16f

Please sign in to comment.