Skip to content

Commit

Permalink
feat: publish dotty version for cross builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mhriemers committed Dec 4, 2024
1 parent b832b8b commit 8e2a74c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 43 deletions.
13 changes: 1 addition & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ lazy val scala213projects = scala212projects ++ Seq[ProjectReference](zioConfigS

lazy val scala3projects =
Seq[ProjectReference](
zioConfigJS,
zioConfigJVM,
zioConfigAwsJVM,
zioConfigZioAwsJVM,
Expand Down Expand Up @@ -168,7 +169,6 @@ lazy val zioConfigJS = zioConfig.js
.settings(libraryDependencies += "dev.zio" %%% "zio-test-sbt" % zioVersion % Test)

lazy val zioConfigJVM = zioConfig.jvm
.settings(dottySettings)
.settings(libraryDependencies += "dev.zio" %%% "zio-test-sbt" % zioVersion % Test)

lazy val zioConfigNative = zioConfig.native
Expand All @@ -178,7 +178,6 @@ lazy val zioConfigAws = crossProject(JVMPlatform)
.in(file("aws"))
.settings(stdSettings("zio-config-aws"))
.settings(crossProjectSettings)
.settings(dottySettings)
.settings(enableMimaSettings)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -197,7 +196,6 @@ lazy val zioConfigZioAws = crossProject(JVMPlatform)
.in(file("zio-aws"))
.settings(stdSettings("zio-config-zio-aws"))
.settings(crossProjectSettings)
.settings(dottySettings)
.settings(enableMimaSettings)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -216,7 +214,6 @@ lazy val zioConfigRefined = crossProject(JVMPlatform)
.in(file("refined"))
.settings(stdSettings("zio-config-refined"))
.settings(crossProjectSettings)
.settings(dottySettings)
.settings(
refinedDependencies,
libraryDependencies ++=
Expand All @@ -234,7 +231,6 @@ lazy val zioConfigPureconfig = crossProject(JVMPlatform)
.in(file("pureconfig"))
.settings(stdSettings("zio-config-pureconfig"))
.settings(crossProjectSettings)
.settings(dottySettings)
.settings(enableMimaSettings)
.settings(
pureconfigDependencies,
Expand Down Expand Up @@ -284,7 +280,6 @@ lazy val zioConfigDerivation = crossProject(JVMPlatform)
.in(file("derivation"))
.settings(stdSettings("zio-config-derivation"))
.settings(crossProjectSettings)
.settings(dottySettings)
.settings(enableMimaSettings)
.dependsOn(zioConfig)

Expand All @@ -294,7 +289,6 @@ lazy val zioConfigMagnolia = crossProject(JVMPlatform)
.in(file("magnolia"))
.settings(stdSettings("zio-config-magnolia"))
.settings(crossProjectSettings)
.settings(dottySettings)
.settings(enableMimaSettings)
.settings(
magnoliaDependencies,
Expand All @@ -319,7 +313,6 @@ lazy val zioConfigTypesafe = crossProject(JVMPlatform)
.in(file("typesafe"))
.settings(stdSettings("zio-config-typesafe"))
.settings(crossProjectSettings)
.settings(dottySettings)
.settings(enableMimaSettings)
.settings(
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -349,7 +342,6 @@ lazy val zioConfigYaml = crossProject(JVMPlatform)
.dependsOn(zioConfig % "compile->compile;test->test")

lazy val zioConfigYamlJVM = zioConfigYaml.jvm
.settings(dottySettings)

lazy val zioConfigXml = crossProject(JVMPlatform)
.in(file("xml"))
Expand All @@ -367,7 +359,6 @@ lazy val zioConfigXml = crossProject(JVMPlatform)
.dependsOn(zioConfig % "compile->compile;test->test")

lazy val zioConfigXmlJVM = zioConfigXml.jvm
.settings(dottySettings)

lazy val zioConfigScalaz = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("scalaz"))
Expand All @@ -385,7 +376,6 @@ lazy val zioConfigScalaz = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.dependsOn(zioConfig % "compile->compile;test->test")

lazy val zioConfigScalazJVM = zioConfigScalaz.jvm
.settings(dottySettings)

lazy val zioConfigCats = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("cats"))
Expand All @@ -402,7 +392,6 @@ lazy val zioConfigCats = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.dependsOn(zioConfig % "compile->compile;test->test")

lazy val zioConfigCatsJVM = zioConfigCats.jvm
.settings(dottySettings)

lazy val zioConfigEnumeratum = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("enumeratum"))
Expand Down
36 changes: 5 additions & 31 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ object BuildHelper {
"UTF-8",
"-feature",
"-unchecked"
) ++
Seq("-Xfatal-warnings")
)

private val std2xOptions = Seq(
"-language:higherKinds",
Expand All @@ -42,7 +41,8 @@ object BuildHelper {
"-Yrangepos",
"-Xlint:_,-missing-interpolator,-type-parameter-shadow",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"
"-Ywarn-value-discard",
"-Xfatal-warnings"
)

private def optimizerOptions(optimize: Boolean) =
Expand All @@ -59,32 +59,6 @@ object BuildHelper {
buildInfoPackage := packageName
)

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

val scalaReflectSettings = Seq(
libraryDependencies ++= Seq("dev.zio" %%% "izumi-reflect" % "1.0.0-M10")
)
Expand Down Expand Up @@ -206,7 +180,7 @@ object BuildHelper {
resolvers +=
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
name := s"$prjName",
crossScalaVersions := Seq(Scala212, Scala213),
crossScalaVersions := Seq(Scala212, Scala213, ScalaDotty),
ThisBuild / scalaVersion := Scala213,
scalacOptions := stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value),
libraryDependencies ++= {
Expand All @@ -224,7 +198,7 @@ object BuildHelper {
"com.github.liancheng" %% "organize-imports" % "0.6.0",
"com.github.vovapolu" %% "scaluzzi" % "0.1.23"
),
Test / parallelExecution := true,
Test / parallelExecution := scalaVersion.value != ScalaDotty,
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
Expand Down

0 comments on commit 8e2a74c

Please sign in to comment.