diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 639de16..c52e83d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -27,11 +27,8 @@ jobs: matrix: # supported scala versions include: - - scala: 3.3.3 - name: Scala3_3 - test-tasks: scalafmtCheck gen-doc coverage test coverageReport - - scala: 3.4.2 - name: Scala3_4 + - scala: 3.5.0 + name: Scala3_5 test-tasks: scalafmtCheck gen-doc coverage test coverageReport steps: @@ -72,18 +69,18 @@ jobs: needs: [ build ] if: github.event_name != 'pull_request' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 #----------- JDK ----------- - name: Setup JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "liberica" java-version: 17 #----------- CACHE ----------- - name: Cache SBT - uses: actions/cache@v3.2.3 + uses: actions/cache@v4 with: # A list of files, directories, and wildcard patterns to cache and restore path: | diff --git a/.mergify.yml b/.mergify.yml index eec5a17..721a374 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -4,7 +4,7 @@ pull_request_rules: - "#approved-reviews-by>=1" - check-success=codecov/patch - check-success=codecov/project - - check-success=build (Scala3_4) + - check-success=build (Scala3_5) - base=main - label!=work-in-progress actions: @@ -13,7 +13,7 @@ pull_request_rules: - name: automatic merge for master when CI passes and author is steward conditions: - author=scala-steward-geirolz[bot] - - check-success=build (Scala3_4) + - check-success=build (Scala3_5) - base=main actions: merge: @@ -21,7 +21,7 @@ pull_request_rules: - name: automatic merge for master when CI passes and author is dependabot conditions: - author=dependabot[bot] - - check-success=build (Scala3_4) + - check-success=build (Scala3_5) - base=main actions: merge: diff --git a/build.sbt b/build.sbt index 940c008..4751f27 100644 --- a/build.sbt +++ b/build.sbt @@ -3,9 +3,8 @@ import sbt.project lazy val prjName = "toolkit" lazy val prjDescription = "A small toolkit to build functional app with managed resources" lazy val org = "com.github.geirolz" -lazy val scala33 = "3.3.3" -lazy val scala34 = "3.5.0" -lazy val supportedScalaVersions = List(scala33, scala34) +lazy val scala35 = "3.5.0" +lazy val supportedScalaVersions = List(scala35) //## global project to no publish ## val copyReadMe = taskKey[Unit]("Copy generated README to main folder.") @@ -45,7 +44,7 @@ lazy val docs: Project = .settings( baseSettings, noPublishSettings, - libraryDependencies ++= ProjectDependencies.Docs.dedicated, + libraryDependencies ++= PrjDependencies.Docs.dedicated, // config scalacOptions --= Seq("-Werror", "-Xfatal-warnings"), mdocIn := file("docs/source"), @@ -193,10 +192,10 @@ lazy val baseSettings: Seq[Def.Setting[_]] = Seq( scalacOptions ++= scalacSettings(scalaVersion.value), versionScheme := Some("early-semver"), // dependencies - resolvers ++= ProjectResolvers.all, + resolvers ++= PrjResolvers.all, libraryDependencies ++= Seq( - ProjectDependencies.common, - ProjectDependencies.Plugins.compilerPlugins + PrjDependencies.common, + PrjDependencies.Plugins.compilerPlugins ).flatten ) diff --git a/integrations/fly4s/src/test/scala/com/geirolz/app/toolkit/fly4s/Fly4sSupportSuite.scala b/integrations/fly4s/src/test/scala/com/geirolz/app/toolkit/fly4s/Fly4sSupportSuite.scala index 2613333..7657cc8 100644 --- a/integrations/fly4s/src/test/scala/com/geirolz/app/toolkit/fly4s/Fly4sSupportSuite.scala +++ b/integrations/fly4s/src/test/scala/com/geirolz/app/toolkit/fly4s/Fly4sSupportSuite.scala @@ -2,7 +2,7 @@ package com.geirolz.app.toolkit.fly4s import cats.effect.IO import com.geirolz.app.toolkit.fly4s.testing.TestConfig -import com.geirolz.app.toolkit.{App, AppMessages, SimpleAppInfo, ctx} +import com.geirolz.app.toolkit.{ctx, App, AppMessages, SimpleAppInfo} import java.time.LocalDateTime @@ -11,13 +11,11 @@ class Fly4sSupportSuite extends munit.CatsEffectSuite: test("Syntax works as expected") { App[IO] .withInfo( - SimpleAppInfo.string( - name = "toolkit", - version = "0.0.1", - scalaVersion = "2.13.10", - sbtVersion = "1.8.0", - builtOn = LocalDateTime.now() - ) + name = "toolkit", + version = "0.0.1", + scalaVersion = "2.13.10", + sbtVersion = "1.8.0", + builtOn = LocalDateTime.now() ) .withConfigPure( TestConfig( diff --git a/integrations/log4cats/src/test/scala/com/geirolz/app/toolkit/logger/Log4CatsLoggerAdapterSuite.scala b/integrations/log4cats/src/test/scala/com/geirolz/app/toolkit/logger/Log4CatsLoggerAdapterSuite.scala index 9deef26..8f8a6d9 100644 --- a/integrations/log4cats/src/test/scala/com/geirolz/app/toolkit/logger/Log4CatsLoggerAdapterSuite.scala +++ b/integrations/log4cats/src/test/scala/com/geirolz/app/toolkit/logger/Log4CatsLoggerAdapterSuite.scala @@ -14,13 +14,11 @@ class Log4CatsLoggerAdapterSuite extends munit.CatsEffectSuite { assertIO_( App[IO] .withInfo( - SimpleAppInfo.string( - name = "toolkit", - version = "0.0.1", - scalaVersion = "2.13.10", - sbtVersion = "1.8.0", - builtOn = LocalDateTime.now() - ) + name = "toolkit", + version = "0.0.1", + scalaVersion = "2.13.10", + sbtVersion = "1.8.0", + builtOn = LocalDateTime.now() ) .withLoggerPure(_ => NoOpLogger[IO]) .withoutDependencies diff --git a/integrations/odin/src/test/scala/com/geirolz/app/toolkit/logger/OdinLoggerAdapterSuite.scala b/integrations/odin/src/test/scala/com/geirolz/app/toolkit/logger/OdinLoggerAdapterSuite.scala index e79b751..36455f0 100644 --- a/integrations/odin/src/test/scala/com/geirolz/app/toolkit/logger/OdinLoggerAdapterSuite.scala +++ b/integrations/odin/src/test/scala/com/geirolz/app/toolkit/logger/OdinLoggerAdapterSuite.scala @@ -13,13 +13,11 @@ class OdinLoggerAdapterSuite extends munit.CatsEffectSuite { assertIO_( App[IO] .withInfo( - SimpleAppInfo.string( - name = "toolkit", - version = "0.0.1", - scalaVersion = "2.13.10", - sbtVersion = "1.8.0", - builtOn = LocalDateTime.now() - ) + name = "toolkit", + version = "0.0.1", + scalaVersion = "2.13.10", + sbtVersion = "1.8.0", + builtOn = LocalDateTime.now() ) .withLoggerPure(_ => OdinLogger.noop[IO]) .withoutDependencies diff --git a/project/PrjDependencies.scala b/project/PrjDependencies.scala new file mode 100644 index 0000000..f0d0a04 --- /dev/null +++ b/project/PrjDependencies.scala @@ -0,0 +1,115 @@ +import sbt.* + +import scala.language.postfixOps + +object PrjDependencies { + + object Versions { + type Version = String + val cats: Version = "2.12.0" + val catsEffect: Version = "3.5.4" + val circe: Version = "0.14.9" + val circeGenericExtra: Version = "0.14.3" + val pureConfig: Version = "0.17.7" + val fly4s: Version = "1.0.8" + val munit: Version = "1.0.0" + val munitEffect: Version = "2.0.0" + val slf4: Version = "2.0.16" + val log4cats: Version = "2.7.0" + val odin: Version = "0.14.0" + val http4s: Version = "0.23.27" + val fs2: Version = "3.11.0" + val scalacheck: Version = "1.18.0" + } + + lazy val common: Seq[ModuleID] = Seq( + // runtime + "org.typelevel" %% "cats-core" % Versions.cats, + + // test + "org.scalameta" %% "munit" % Versions.munit % Test, + "org.scalameta" %% "munit-scalacheck" % Versions.munit % Test, + "org.typelevel" %% "munit-cats-effect" % Versions.munitEffect % Test, + "org.scalacheck" %% "scalacheck" % Versions.scalacheck % Test + ) + + object Core { + lazy val dedicated: Seq[ModuleID] = Seq( + // runtime + "org.typelevel" %% "cats-effect" % Versions.catsEffect + ) + } + + object Config { + lazy val dedicated: Seq[ModuleID] = Nil + } + + object Testing { + lazy val dedicated: Seq[ModuleID] = Seq( + // runtime + "org.typelevel" %% "cats-effect" % Versions.catsEffect + ) + } + + object Examples { + + lazy val dedicated: Seq[ModuleID] = Seq( + // http + "org.http4s" %% "http4s-dsl" % Versions.http4s, + "org.http4s" %% "http4s-ember-server" % Versions.http4s, + + // streaming + "co.fs2" %% "fs2-core" % Versions.fs2, + + // logging + "org.typelevel" %% "log4cats-slf4j" % Versions.log4cats, + "org.slf4j" % "slf4j-api" % Versions.slf4, + "org.slf4j" % "slf4j-simple" % Versions.slf4, + + // config + "com.github.pureconfig" %% "pureconfig-http4s" % Versions.pureConfig, + "com.github.pureconfig" %% "pureconfig-ip4s" % Versions.pureConfig, + + // json + "io.circe" %% "circe-core" % Versions.circe, + "io.circe" %% "circe-refined" % Versions.circe, + "io.circe" %% "circe-generic" % Versions.circe + ) + } + + object Integrations { + + object Log4cats { + lazy val dedicated: Seq[ModuleID] = List( + "org.typelevel" %% "log4cats-core" % Versions.log4cats, + "org.typelevel" %% "log4cats-noop" % Versions.log4cats % Test + ) + } + + object Odin { + lazy val dedicated: Seq[ModuleID] = List( + "dev.scalafreaks" %% "odin-core" % Versions.odin + ) + } + + object Pureconfig { + lazy val dedicated: Seq[ModuleID] = List( + "com.github.pureconfig" %% "pureconfig-core" % Versions.pureConfig + ) + } + + object Fly4s { + lazy val dedicated: Seq[ModuleID] = List( + "com.github.geirolz" %% "fly4s" % Versions.fly4s + ) + } + } + + object Plugins { + val compilerPlugins: Seq[ModuleID] = Nil + } + + object Docs { + lazy val dedicated: Seq[ModuleID] = Examples.dedicated + } +} diff --git a/project/ProjectResolvers.scala b/project/PrjResolvers.scala similarity index 93% rename from project/ProjectResolvers.scala rename to project/PrjResolvers.scala index 607ecb7..d2ba17c 100644 --- a/project/ProjectResolvers.scala +++ b/project/PrjResolvers.scala @@ -1,7 +1,7 @@ import sbt.{Resolver, _} import sbt.librarymanagement.MavenRepository -object ProjectResolvers { +object PrjResolvers { lazy val all: Seq[MavenRepository] = Seq( Resolver.sonatypeOssRepos("public"), diff --git a/project/ProjectDependencies.scala b/project/ProjectDependencies.scala deleted file mode 100644 index c902cdc..0000000 --- a/project/ProjectDependencies.scala +++ /dev/null @@ -1,112 +0,0 @@ -import sbt.* - -import scala.language.postfixOps - -object ProjectDependencies { - - private val catsVersion = "2.12.0" - private val catsEffectVersion = "3.5.4" - private val circeVersion = "0.14.9" - private val circeGenericExtraVersion = "0.14.3" - private val pureConfigVersion = "0.17.7" - private val fly4sVersion = "1.0.8" - private val munitVersion = "1.0.0" - private val munitEffectVersion = "2.0.0" - private val slf4Version = "2.0.16" - private val log4catsVersion = "2.7.0" - private val odinVersion = "0.14.0" - private val http4sVersion = "0.23.27" - private val fs2Version = "3.11.0" - private val scalacheck = "1.18.0" - - lazy val common: Seq[ModuleID] = Seq( - // runtime - "org.typelevel" %% "cats-core" % catsVersion, - - // test - "org.scalameta" %% "munit" % munitVersion % Test, - "org.scalameta" %% "munit-scalacheck" % munitVersion % Test, - "org.typelevel" %% "munit-cats-effect" % munitEffectVersion % Test, - "org.scalacheck" %% "scalacheck" % scalacheck % Test - ) - - object Core { - lazy val dedicated: Seq[ModuleID] = Seq( - // runtime - "org.typelevel" %% "cats-effect" % catsEffectVersion - ) - } - - object Config { - lazy val dedicated: Seq[ModuleID] = Nil - } - - object Testing { - lazy val dedicated: Seq[ModuleID] = Seq( - // runtime - "org.typelevel" %% "cats-effect" % catsEffectVersion - ) - } - - object Examples { - - lazy val dedicated: Seq[ModuleID] = Seq( - // http - "org.http4s" %% "http4s-dsl" % http4sVersion, - "org.http4s" %% "http4s-ember-server" % http4sVersion, - - // streaming - "co.fs2" %% "fs2-core" % fs2Version, - - // logging - "org.typelevel" %% "log4cats-slf4j" % log4catsVersion, - "org.slf4j" % "slf4j-api" % slf4Version, - "org.slf4j" % "slf4j-simple" % slf4Version, - - // config - "com.github.pureconfig" %% "pureconfig-http4s" % pureConfigVersion, - "com.github.pureconfig" %% "pureconfig-ip4s" % pureConfigVersion, - - // json - "io.circe" %% "circe-core" % circeVersion, - "io.circe" %% "circe-refined" % circeVersion, - "io.circe" %% "circe-generic" % circeVersion - ) - } - - object Integrations { - - object Log4cats { - lazy val dedicated: Seq[ModuleID] = List( - "org.typelevel" %% "log4cats-core" % log4catsVersion, - "org.typelevel" %% "log4cats-noop" % log4catsVersion % Test - ) - } - - object Odin { - lazy val dedicated: Seq[ModuleID] = List( - "dev.scalafreaks" %% "odin-core" % odinVersion - ) - } - - object Pureconfig { - lazy val dedicated: Seq[ModuleID] = List( - "com.github.pureconfig" %% "pureconfig-core" % pureConfigVersion - ) - } - - object Fly4s { - lazy val dedicated: Seq[ModuleID] = List( - "com.github.geirolz" %% "fly4s" % fly4sVersion - ) - } - } - - object Plugins { - val compilerPlugins: Seq[ModuleID] = Nil - } - - object Docs { - lazy val dedicated: Seq[ModuleID] = Examples.dedicated - } -}