diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98e9c90..86fa1ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: scala: - { name: "Scala 2", version: "2.12.13", binary-version: "2.12", java-version: "11", java-distribution: "temurin", report: "" } - { name: "Scala 2", version: "2.13.6", binary-version: "2.13", java-version: "11", java-distribution: "temurin", report: "report" } - - { name: "Scala 3", version: "3.0.2", binary-version: "3", java-version: "11", java-distribution: "temurin", report: "" } + - { name: "Scala 3", version: "3.1.3", binary-version: "3", java-version: "11", java-distribution: "temurin", report: "" } steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1f7baf..8acc955 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: scala: - { name: "Scala 2", version: "2.12.13", binary-version: "2.12", java-version: "11", java-distribution: "temurin", report: "" } - { name: "Scala 2", version: "2.13.6", binary-version: "2.13", java-version: "11", java-distribution: "temurin", report: "" } - - { name: "Scala 3", version: "3.0.2", binary-version: "3", java-version: "11", java-distribution: "temurin", report: "" } + - { name: "Scala 3", version: "3.1.3", binary-version: "3", java-version: "11", java-distribution: "temurin", report: "" } steps: - uses: actions/checkout@v4 diff --git a/build.sbt b/build.sbt index 9bf094c..a5e8d02 100644 --- a/build.sbt +++ b/build.sbt @@ -71,30 +71,41 @@ lazy val loggerF = (project in file(".")) .aggregate( coreJvm, coreJs, + coreNative, slf4jLoggerJvm, slf4jLoggerJs, + slf4jLoggerNative, log4sLoggerJvm, log4sLoggerJs, + log4sLoggerNative, log4jLoggerJvm, log4jLoggerJs, + log4jLoggerNative, sbtLoggingJvm, sbtLoggingJs, + sbtLoggingNative, catsJvm, catsJs, + catsNative, logbackMdcMonix3Jvm, logbackMdcMonix3Js, + logbackMdcMonix3Native, testKitJvm, testKitJs, + testKitNative, catsEffectJvm, catsEffectJs, + catsEffectNative, catsEffect3Jvm, catsEffect3Js, + catsEffect3Native, monixJvm, monixJs, + monixNative, ) -lazy val core = - module(ProjectName("core"), crossProject(JVMPlatform, JSPlatform)) +lazy val core = + module(ProjectName("core"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Core", libraryDependencies ++= List( @@ -108,10 +119,11 @@ lazy val core = libraryDependencies.value, ), ) -lazy val coreJvm = core.jvm -lazy val coreJs = core.js +lazy val coreJvm = core.jvm +lazy val coreJs = core.js +lazy val coreNative = core.native.settings(nativeSettings) -lazy val slf4jLogger = module(ProjectName("slf4j"), crossProject(JVMPlatform, JSPlatform)) +lazy val slf4jLogger = module(ProjectName("slf4j"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Logger with Slf4j", libraryDependencies ++= Seq( @@ -123,11 +135,12 @@ lazy val slf4jLogger = module(ProjectName("slf4j"), crossProject(JVMPlatform, ), ) .dependsOn(core) -lazy val slf4jLoggerJvm = slf4jLogger.jvm -lazy val slf4jLoggerJs = slf4jLogger.js +lazy val slf4jLoggerJvm = slf4jLogger.jvm +lazy val slf4jLoggerJs = slf4jLogger.js +lazy val slf4jLoggerNative = slf4jLogger.native.settings(nativeSettings) -lazy val log4sLogger = - module(ProjectName("log4s"), crossProject(JVMPlatform, JSPlatform)) +lazy val log4sLogger = + module(ProjectName("log4s"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Logger with Log4s", libraryDependencies := libraryDependenciesRemoveScala3Incompatible( @@ -139,11 +152,12 @@ lazy val log4sLogger = ), ) .dependsOn(core) -lazy val log4sLoggerJvm = log4sLogger.jvm -lazy val log4sLoggerJs = log4sLogger.js +lazy val log4sLoggerJvm = log4sLogger.jvm +lazy val log4sLoggerJs = log4sLogger.js +lazy val log4sLoggerNative = log4sLogger.native.settings(nativeSettings) -lazy val log4jLogger = - module(ProjectName("log4j"), crossProject(JVMPlatform, JSPlatform)) +lazy val log4jLogger = + module(ProjectName("log4j"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Logger with Log4j", Compile / unmanagedSourceDirectories ++= { @@ -199,11 +213,12 @@ lazy val log4jLogger = ), ) .dependsOn(core) -lazy val log4jLoggerJvm = log4jLogger.jvm -lazy val log4jLoggerJs = log4jLogger.js +lazy val log4jLoggerJvm = log4jLogger.jvm +lazy val log4jLoggerJs = log4jLogger.js +lazy val log4jLoggerNative = log4jLogger.native.settings(nativeSettings) -lazy val sbtLogging = - module(ProjectName("sbt-logging"), crossProject(JVMPlatform, JSPlatform)) +lazy val sbtLogging = + module(ProjectName("sbt-logging"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Logger with sbt logging", libraryDependencies ++= crossVersionProps( @@ -231,11 +246,12 @@ lazy val sbtLogging = ), ) .dependsOn(core) -lazy val sbtLoggingJvm = sbtLogging.jvm -lazy val sbtLoggingJs = sbtLogging.js +lazy val sbtLoggingJvm = sbtLogging.jvm +lazy val sbtLoggingJs = sbtLogging.js +lazy val sbtLoggingNative = sbtLogging.native.settings(nativeSettings) -lazy val cats = - module(ProjectName("cats"), crossProject(JVMPlatform, JSPlatform)) +lazy val cats = + module(ProjectName("cats"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Cats", libraryDependencies ++= libs.tests.hedgehogLibs ++ List( @@ -250,10 +266,11 @@ lazy val cats = ), ) .dependsOn(core % props.IncludeTest) -lazy val catsJvm = cats.jvm -lazy val catsJs = cats.js +lazy val catsJvm = cats.jvm +lazy val catsJs = cats.js +lazy val catsNative = cats.native.settings(nativeSettings) -lazy val logbackMdcMonix3 = module(ProjectName("logback-mdc-monix3"), crossProject(JVMPlatform, JSPlatform)) +lazy val logbackMdcMonix3 = module(ProjectName("logback-mdc-monix3"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - logback MDC context map support for Monix 3", libraryDependencies ++= Seq( @@ -273,11 +290,12 @@ lazy val logbackMdcMonix3 = module(ProjectName("logback-mdc-monix3"), crossPr monix % Test, slf4jLogger % Test, ) -lazy val logbackMdcMonix3Jvm = logbackMdcMonix3.jvm -lazy val logbackMdcMonix3Js = logbackMdcMonix3.js +lazy val logbackMdcMonix3Jvm = logbackMdcMonix3.jvm +lazy val logbackMdcMonix3Js = logbackMdcMonix3.js +lazy val logbackMdcMonix3Native = logbackMdcMonix3.native.settings(nativeSettings) -lazy val testKit = - module(ProjectName("test-kit"), crossProject(JVMPlatform, JSPlatform)) +lazy val testKit = + module(ProjectName("test-kit"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Test Kit", libraryDependencies ++= libs.tests.hedgehogLibs ++ @@ -291,11 +309,12 @@ lazy val testKit = ), ) .dependsOn(core % props.IncludeTest) -lazy val testKitJvm = testKit.jvm -lazy val testKitJs = testKit.js +lazy val testKitJvm = testKit.jvm +lazy val testKitJs = testKit.js +lazy val testKitNative = testKit.native.settings(nativeSettings) -lazy val catsEffect = - module(ProjectName("cats-effect"), crossProject(JVMPlatform, JSPlatform)) +lazy val catsEffect = + module(ProjectName("cats-effect"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Cats Effect", libraryDependencies ++= libs.tests.hedgehogLibs ++ List(libs.effectieCatsEffect2 % Test), @@ -306,11 +325,12 @@ lazy val catsEffect = ) .settings(noPublish) .dependsOn(core % props.IncludeTest, cats) -lazy val catsEffectJvm = catsEffect.jvm -lazy val catsEffectJs = catsEffect.js +lazy val catsEffectJvm = catsEffect.jvm +lazy val catsEffectJs = catsEffect.js +lazy val catsEffectNative = catsEffect.native.settings(nativeSettings) -lazy val catsEffect3 = - module(ProjectName("cats-effect3"), crossProject(JVMPlatform, JSPlatform)) +lazy val catsEffect3 = + module(ProjectName("cats-effect3"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Cats Effect 3", libraryDependencies ++= libs.tests.hedgehogLibs ++ List( @@ -324,11 +344,12 @@ lazy val catsEffect3 = ) .settings(noPublish) .dependsOn(core % props.IncludeTest, cats) -lazy val catsEffect3Jvm = catsEffect3.jvm -lazy val catsEffect3Js = catsEffect3.js +lazy val catsEffect3Jvm = catsEffect3.jvm +lazy val catsEffect3Js = catsEffect3.js +lazy val catsEffect3Native = catsEffect3.native.settings(nativeSettings) -lazy val monix = - module(ProjectName("monix"), crossProject(JVMPlatform, JSPlatform)) +lazy val monix = + module(ProjectName("monix"), crossProject(JVMPlatform, JSPlatform, NativePlatform)) .settings( description := "Logger for F[_] - Monix", libraryDependencies ++= libs.tests.hedgehogLibs ++ List(libs.effectieMonix % Test), @@ -339,13 +360,14 @@ lazy val monix = ) .settings(noPublish) .dependsOn(core % props.IncludeTest, cats) -lazy val monixJvm = monix.jvm -lazy val monixJs = monix.js +lazy val monixJvm = monix.jvm +lazy val monixJs = monix.js +lazy val monixNative = monix.native.settings(nativeSettings) -lazy val testCatsEffectWithSlf4jLogger = +lazy val testCatsEffectWithSlf4jLogger = testProject( ProjectName("cats-effect-slf4j"), - crossProject(JVMPlatform, JSPlatform), + crossProject(JVMPlatform, JSPlatform, NativePlatform), ) .settings( description := "Test Logger for F[_] - Logger with Slf4j", @@ -357,13 +379,14 @@ lazy val testCatsEffectWithSlf4jLogger = ) .settings(noPublish) .dependsOn(core % props.IncludeTest, slf4jLogger, catsEffect % props.IncludeTest) -lazy val testCatsEffectWithSlf4jLoggerJvm = testCatsEffectWithSlf4jLogger.jvm -lazy val testCatsEffectWithSlf4jLoggerJs = testCatsEffectWithSlf4jLogger.js +lazy val testCatsEffectWithSlf4jLoggerJvm = testCatsEffectWithSlf4jLogger.jvm +lazy val testCatsEffectWithSlf4jLoggerJs = testCatsEffectWithSlf4jLogger.js +lazy val testCatsEffectWithSlf4jLoggerNative = testCatsEffectWithSlf4jLogger.native.settings(nativeSettings) -lazy val testMonixWithSlf4jLogger = +lazy val testMonixWithSlf4jLogger = testProject( ProjectName("monix-slf4j"), - crossProject(JVMPlatform, JSPlatform), + crossProject(JVMPlatform, JSPlatform, NativePlatform), ) .settings( description := "Test Logger for F[_] - Logger with Slf4j", @@ -375,13 +398,14 @@ lazy val testMonixWithSlf4jLogger = ) .settings(noPublish) .dependsOn(core % props.IncludeTest, slf4jLogger, monix % props.IncludeTest) -lazy val testMonixWithSlf4jLoggerJvm = testMonixWithSlf4jLogger.jvm -lazy val testMonixWithSlf4jLoggerJs = testMonixWithSlf4jLogger.js +lazy val testMonixWithSlf4jLoggerJvm = testMonixWithSlf4jLogger.jvm +lazy val testMonixWithSlf4jLoggerJs = testMonixWithSlf4jLogger.js +lazy val testMonixWithSlf4jLoggerNative = testMonixWithSlf4jLogger.native.settings(nativeSettings) -lazy val testCatsEffectWithLog4sLogger = +lazy val testCatsEffectWithLog4sLogger = testProject( ProjectName("cats-effect-log4s"), - crossProject(JVMPlatform, JSPlatform), + crossProject(JVMPlatform, JSPlatform, NativePlatform), ) .settings( description := "Test Logger for F[_] - Logger with Log4s", @@ -393,13 +417,14 @@ lazy val testCatsEffectWithLog4sLogger = ) .settings(noPublish) .dependsOn(core % props.IncludeTest, log4sLogger, catsEffect % props.IncludeTest) -lazy val testCatsEffectWithLog4sLoggerJvm = testCatsEffectWithLog4sLogger.jvm -lazy val testCatsEffectWithLog4sLoggerJs = testCatsEffectWithLog4sLogger.js +lazy val testCatsEffectWithLog4sLoggerJvm = testCatsEffectWithLog4sLogger.jvm +lazy val testCatsEffectWithLog4sLoggerJs = testCatsEffectWithLog4sLogger.js +lazy val testCatsEffectWithLog4sLoggerNative = testCatsEffectWithLog4sLogger.native.settings(nativeSettings) -lazy val testCatsEffectWithLog4jLogger = +lazy val testCatsEffectWithLog4jLogger = testProject( ProjectName("cats-effect-log4j"), - crossProject(JVMPlatform, JSPlatform), + crossProject(JVMPlatform, JSPlatform, NativePlatform), ) .settings( description := "Test Logger for F[_] - Logger with Log4j", @@ -411,8 +436,9 @@ lazy val testCatsEffectWithLog4jLogger = ) .settings(noPublish) .dependsOn(core % props.IncludeTest, log4jLogger, catsEffect % props.IncludeTest) -lazy val testCatsEffectWithLog4jLoggerJvm = testCatsEffectWithLog4jLogger.jvm -lazy val testCatsEffectWithLog4jLoggerJs = testCatsEffectWithLog4jLogger.js +lazy val testCatsEffectWithLog4jLoggerJvm = testCatsEffectWithLog4jLogger.jvm +lazy val testCatsEffectWithLog4jLoggerJs = testCatsEffectWithLog4jLogger.js +lazy val testCatsEffectWithLog4jLoggerNative = testCatsEffectWithLog4jLogger.native.settings(nativeSettings) lazy val docs = (project in file("docs-gen-tmp/docs")) .enablePlugins(MdocPlugin, DocusaurPlugin) @@ -514,7 +540,7 @@ lazy val props = final val GitHubUsername = "Kevin-Lee" final val RepoName = "logger-f" - final val Scala3Versions = List("3.0.2") + final val Scala3Versions = List("3.1.3") final val Scala2Versions = List("2.13.6", "2.12.13") // final val ProjectScalaVersion = Scala3Versions.head @@ -693,3 +719,7 @@ def projectCommonSettings(projectName: String, crossProject: CrossProject.Builde .settings( mavenCentralPublishSettings ) + +lazy val nativeSettings: SettingsDefinition = List( + Test / fork := false +) diff --git a/project/plugins.sbt b/project/plugins.sbt index 9da7e60..23bd9ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -15,6 +15,11 @@ addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.15.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.11") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") + +addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.2") + val sbtDevOopsVersion = "3.0.0" addSbtPlugin("io.kevinlee" % "sbt-devoops-scala" % sbtDevOopsVersion) addSbtPlugin("io.kevinlee" % "sbt-devoops-sbt-extra" % sbtDevOopsVersion)