From b1fc130f94b6ed2dc3f60b707e16fac91f10311e Mon Sep 17 00:00:00 2001 From: Martijn Riemers <4195489+mhriemers@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:24:19 +0100 Subject: [PATCH] feat: publish dotty version for cross builds (#355) * feat: publish dotty version for cross builds * enable parallel test execution for scala 2.* --- build.sbt | 3 --- project/BuildHelper.scala | 40 ++++++--------------------------------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/build.sbt b/build.sbt index 1e23718a..b4510507 100644 --- a/build.sbt +++ b/build.sbt @@ -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")) @@ -92,7 +91,6 @@ lazy val examples = crossProject(JSPlatform, JVMPlatform, NativePlatform) "dev.zio" %% "zio-streams" % zioVersion ) ) - .jvmSettings(dottySettings) .jsSettings(scalaJSUseMainModuleInitializer := true) .dependsOn(zioCli) @@ -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 diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 513d9489..45633e4d 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -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" @@ -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( @@ -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 ++= { @@ -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")