From c3ddc8faf2cb4c76aa9aeb32bb3b5fcbe54b40a7 Mon Sep 17 00:00:00 2001 From: Ihor Vovk Date: Wed, 3 Jul 2024 15:46:50 +0200 Subject: [PATCH] Sonatype central (#5) --- README.md | 7 ++++--- build.sbt | 4 ++++ project/plugins.sbt | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dbab894..612bcf3 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # Cats-Effect-Simple-DI -A tiny library that allows you to make simple dependency injection with Cats Effect. +A tiny library that makes dependency injection with [cats-effect](https://github.com/typelevel/cats-effect) simple. This is a follow-up of the [article](https://medium.com/@ivovk/dependency-injection-with-cats-effect-resource-monad-ad7cd47b977) I wrote about the topic. -Traditional approach to Dependency Injection with Cats Effect is to build a single for-comprehension that wires all the +Traditional approach to dependency enjection with cats-effect is to build a single for-comprehension that wires all the dependencies together. This approach is not very scalable and can become quite messy as the number of dependencies grows. -The suggested approach would be: +The suggested approach with this library would be: ```scala import io.github.cats_effect_simple_di.Allocator @@ -70,6 +70,7 @@ You can have multiple dependencies objects and combine them together. In this ca in `allocator.allocate{}` so that they are shut down in the right order: Example reusing the same `Allocator` object: + ```scala // AWS - specific dependencies class AwsDependencies(allocator: Allocator) { diff --git a/build.sbt b/build.sbt index 93d04bd..702122c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,5 @@ +import xerial.sbt.Sonatype.sonatypeCentralHost + name := "cats-effect-simple-di" scalaVersion := "3.3.3" @@ -17,6 +19,8 @@ inThisBuild(List( ) )) +ThisBuild / sonatypeCredentialHost := sonatypeCentralHost + lazy val Versions = new { val catsEffect = "3.5.4" val scalatest = "3.2.18" diff --git a/project/plugins.sbt b/project/plugins.sbt index d77db57..48ee6ec 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1,2 @@ -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") \ No newline at end of file +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.0") \ No newline at end of file