Skip to content

Commit

Permalink
feat: publish dotty version for cross builds (#355)
Browse files Browse the repository at this point in the history
* feat: publish dotty version for cross builds

* enable parallel test execution for scala 2.*
  • Loading branch information
mhriemers authored Dec 4, 2024
1 parent 5b50902 commit b1fc130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 37 deletions.
3 changes: 0 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ lazy val zioCli = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.jsSettings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion % Test
)
.jvmSettings(dottySettings)
.jsSettings(scalaJSUseMainModuleInitializer := true)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))

Expand All @@ -92,7 +91,6 @@ lazy val examples = crossProject(JSPlatform, JVMPlatform, NativePlatform)
"dev.zio" %% "zio-streams" % zioVersion
)
)
.jvmSettings(dottySettings)
.jsSettings(scalaJSUseMainModuleInitializer := true)
.dependsOn(zioCli)

Expand Down Expand Up @@ -144,7 +142,6 @@ lazy val testkit = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.jsSettings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion % Test
)
.jvmSettings(dottySettings)
.jsSettings(scalaJSUseMainModuleInitializer := true)
.dependsOn(zioCli)
Global / onChangedBuildSource := ReloadOnSourceChanges
40 changes: 6 additions & 34 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ object BuildHelper {
"-language:implicitConversions",
"-Xignore-scala2-macros"
)
case Some((3, _)) =>
Seq(
"-noindent"
)
case Some((2, 13)) =>
Seq(
"-Ywarn-unused:params,-implicits"
Expand Down Expand Up @@ -131,38 +135,6 @@ object BuildHelper {
platformSpecificSources(platform, conf, baseDir)(versions: _*)
}

val dottySettings = 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
}
}
)

lazy val crossProjectSettings = Seq(
Compile / unmanagedSourceDirectories ++= {
crossPlatformSources(
Expand All @@ -184,7 +156,7 @@ object BuildHelper {

def stdSettings(prjName: String) = Seq(
name := s"$prjName",
crossScalaVersions := Seq(Scala212, Scala213),
crossScalaVersions := Seq(Scala212, Scala213, Scala3),
ThisBuild / scalaVersion := Scala213,
scalacOptions ++= stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value),
libraryDependencies ++= {
Expand All @@ -206,7 +178,7 @@ object BuildHelper {
"com.github.liancheng" %% "organize-imports" % "0.5.0",
"com.github.vovapolu" %% "scaluzzi" % "0.1.16"
),
Test / parallelExecution := true,
Test / parallelExecution := scalaVersion.value != Scala3,
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
Expand Down

0 comments on commit b1fc130

Please sign in to comment.