Skip to content

Commit

Permalink
Reverted zio2 logging and fixed build settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grryum committed Nov 22, 2023
1 parent c212520 commit ea26dbe
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
40 changes: 25 additions & 15 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ lazy val higherKindCore = project
.in(modules / "kernel" / "higherKind")
.settings(
defaultSettings,
crossScalaVersions := Vector(Version.scala212, Version.scala213, Version.scala3),
name := "tofu-core-higher-kind",
scala3MigratedModuleOptions,
name := "tofu-core-higher-kind",
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) =>
Expand All @@ -53,8 +53,8 @@ lazy val kernel = project
.dependsOn(higherKindCore)
.settings(
defaultSettings,
crossScalaVersions := Vector(Version.scala212, Version.scala213, Version.scala3),
name := "tofu-kernel",
scala3MigratedModuleOptions,
name := "tofu-kernel",
libraryDependencies += glassCore
)

Expand All @@ -63,8 +63,8 @@ lazy val coreCE2 = project
.dependsOn(kernel)
.settings(
defaultSettings,
crossScalaVersions := Vector(Version.scala212, Version.scala213, Version.scala3),
name := "tofu-core-ce2",
scala3MigratedModuleOptions,
name := "tofu-core-ce2",
libraryDependencies += catsEffect2
)

Expand All @@ -84,8 +84,8 @@ lazy val coreCE3 = project
.dependsOn(kernel)
.settings(
defaultSettings,
crossScalaVersions := Vector(Version.scala212, Version.scala213, Version.scala3),
name := "tofu-core-ce3",
scala3MigratedModuleOptions,
name := "tofu-core-ce3",
libraryDependencies += catsEffect3
)

Expand Down Expand Up @@ -270,7 +270,12 @@ lazy val zio1Core =
lazy val zio2Core =
project
.in(modules / "interop" / "zio2" / "core")
.settings(defaultSettings, libraryDependencies ++= List(zio2, zio2Cats), name := "tofu-zio2-core")
.settings(
defaultSettings,
scala3MigratedModuleOptions,
libraryDependencies ++= List(zio2, zio2Cats),
name := "tofu-zio2-core"
)
.dependsOn(coreCE3)

lazy val zio1Logging =
Expand Down Expand Up @@ -458,12 +463,6 @@ lazy val tofu = project

lazy val defaultScalacOptions =
Seq(
tpolecatScalacOptions ++= Set(
ScalacOption("-Ykind-projector:underscores", _ >= ScalaVersion.V3_0_0),
ScalacOption("-P:kind-projector:underscore-placeholders", _ < ScalaVersion.V3_0_0),
ScalacOptions.source3,
ScalacOption("-Xmigration", _ < ScalaVersion.V3_0_0)
),
tpolecatExcludeOptions ++= Set(ScalacOptions.warnDeadCode, ScalacOptions.privateWarnDeadCode),
tpolecatExcludeOptions ++= (
if (!sys.env.get("CI").contains("true") || (minorVersion.value == 12))
Expand All @@ -473,6 +472,17 @@ lazy val defaultScalacOptions =
)
)

lazy val scala3MigratedModuleOptions =
Seq(
tpolecatScalacOptions ++= Set(
ScalacOption("-Ykind-projector:underscores", _ >= ScalaVersion.V3_0_0),
ScalacOption("-P:kind-projector:underscore-placeholders", _ < ScalaVersion.V3_0_0),
ScalacOptions.source3,
ScalacOption("-Xmigration", _ < ScalaVersion.V3_0_0)
),
crossScalaVersions := Vector(Version.scala212, Version.scala213, Version.scala3)
)

lazy val scalacWarningConfig = tpolecatScalacOptions ++= {
// // ignore unused imports that cannot be removed due to cross-compilation
// val suppressUnusedImports = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import scala.annotation.unused

object ZLogging {

type ZMake[R] = Logging.Make[URIO[R, _]]
type ZMake[R] = Logging.Make[URIO[R, *]]

type Make = Logging.Make[UIO]

def empty[R]: ZLogging[R] = new Logging[URIO[R, _]] {
def empty[R]: ZLogging[R] = new Logging[URIO[R, *]] {
override def write(level: Logging.Level, message: String, values: LoggedValue*): URIO[R, Unit] = ZIO.unit
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import scala.annotation.unused
object ZLogs {

private def make[R](f: Logger => ZLogging[R]) =
new Logs[UIO, URIO[R, _]] {
new Logs[UIO, URIO[R, *]] {
override def byName(name: String): UIO[ZLogging[R]] =
ZIO.succeed(LoggerFactory.getLogger(name)).map(f)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package tofu.logging
import zio.{UIO, URIO}

package object zlogs {
type ZLogs[R] = Logs[UIO, URIO[R, _]]
type ZLogs[R] = Logs[UIO, URIO[R, *]]
type ULogs = Logs[UIO, UIO]
type ZLogging[R] = Logging[URIO[R, _]]
type ZLogging[R] = Logging[URIO[R, *]]
type ULogging = Logging[UIO]
}

0 comments on commit ea26dbe

Please sign in to comment.