Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dacr committed Jun 15, 2024
1 parent 14f6643 commit d0600f0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 31 deletions.
20 changes: 9 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ scmInfo := Some(
)
)

scalaVersion := "3.3.1"
scalaVersion := "3.4.2"

scalacOptions += "-Ykind-projector:underscores"

mainClass := Some("fr.janalyse.cem.Main")

lazy val versions = new {
val sttp = "3.9.1"
val zio = "2.0.21"
val sttp = "3.9.7"
val zio = "2.1.3"
val zionio = "2.0.2"
val zioproc = "0.7.2"
val zioconfig = "4.0.0"
val ziologging = "2.1.16"
val ziolmdb = "1.7.1"
val zioconfig = "4.0.2"
val ziologging = "2.3.0"
val ziolmdb = "1.8.0"
val naturalsort = "1.0.4"
val jgit = "6.8.0.202311291450-r"
// val logback = "1.4.7"
val log4j2 = "2.20.0"
val jgit = "6.10.0.202406032230-r"
}

libraryDependencies ++= Seq(
Expand All @@ -50,8 +50,6 @@ libraryDependencies ++= Seq(
"org.eclipse.jgit" % "org.eclipse.jgit" % versions.jgit
)

//excludeDependencies += "org.scala-lang.modules" % "scala-collection-compat_2.13"

testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")

enablePlugins(SbtTwirl)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# suppress inspection "UnusedProperty" for whole file
sbt.version=1.9.8
sbt.version=1.10.0
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("com.typesafe.play" % "sbt-twirl" % "1.6.4")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("com.typesafe.play" % "sbt-twirl" % "1.6.6")
9 changes: 3 additions & 6 deletions src/main/scala/fr/janalyse/cem/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import zio.*
import zio.config.*
import zio.config.typesafe.*
import zio.config.magnolia.*

import zio.logging.{LogFormat, removeDefaultLoggers, consoleLogger}
import zio.logging.{ConsoleLoggerConfig, LogFormat, consoleLogger}
import zio.logging.slf4j.bridge.Slf4jBridge
import sttp.client3.asynchttpclient.zio.AsyncHttpClientZioBackend
import zio.Runtime.removeDefaultLoggers
import zio.lmdb.{LMDB, LMDBConfig}

object Main extends ZIOAppDefault {
Expand Down Expand Up @@ -37,10 +37,7 @@ object Main extends ZIOAppDefault {

val configLayer = ZLayer.fromZIO(configProviderLogic.map(provider => Runtime.setConfigProvider(provider))).flatten

override val bootstrap =
//removeDefaultLoggers ++ SLF4J.slf4j(format = LogFormat.colored) ++ ZLayer.fromZIO(configProviderLogic.map(provider => Runtime.setConfigProvider(provider))).flatten
configLayer ++ (removeDefaultLoggers >>> configLayer >>> consoleLogger(configPath = "logger") >>> Slf4jBridge.initialize)

override val bootstrap = configLayer ++ ( removeDefaultLoggers >>> configLayer >>> consoleLogger() >>> Slf4jBridge.initialize)

val httpClientLayer = AsyncHttpClientZioBackend.layer()

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/fr/janalyse/cem/RemoteGithubOperations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ object RemoteGithubOperations {
Obj(
"description" -> Str(description),
"public" -> Bool(publicBool),
"files" -> Obj(files: _*)
"files" -> Obj(files*)
)
}

Expand Down Expand Up @@ -221,7 +221,7 @@ object RemoteGithubOperations {

Obj(
"description" -> Str(description),
"files" -> Obj(files: _*)
"files" -> Obj(files*)
)
}

Expand Down
15 changes: 9 additions & 6 deletions src/test/scala/fr/janalyse/cem/RemoteGithubOperationsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import fr.janalyse.cem.model.WhatToDo.*
import fr.janalyse.cem.tools.DescriptionTools.*
import org.junit.runner.RunWith
import sttp.client3.asynchttpclient.zio.AsyncHttpClientZioBackend
import sttp.capabilities.zio.ZioStreams
import sttp.capabilities.WebSockets
import sttp.client3.testing.SttpBackendStub
import zio.nio.file.Path
import zio.lmdb.LMDB

Expand Down Expand Up @@ -85,13 +88,13 @@ class RemoteGithubOperationsSpec extends ZIOSpecDefault {
results <- githubRemoteExamplesChangesApply(config, todos)
} yield results

val stubbedLayer = ZLayer.succeed(
AsyncHttpClientZioBackend.stub
.whenRequestMatches(_.uri.toString() == "https://api.github.com/gists/6e40f8239fa6828ab45a064b8131fdfc")
.thenRespond("""{"id":"aa-bb", "html_url":"https://truc/aa-bb"}""")
)
val stub: SttpBackendStub[Task, Any] = AsyncHttpClientZioBackend.stub
.whenRequestMatches(_.uri.toString() == "https://api.github.com/gists/6e40f8239fa6828ab45a064b8131fdfc")
.thenRespond("""{"id":"aa-bb", "html_url":"https://truc/aa-bb"}""")

val stubLayer = ZLayer.succeed(stub)

logic.provide(stubbedLayer).map(result => assertTrue(true))
logic.provide(stubLayer).map(result => assertTrue(true))
}

// ----------------------------------------------------------------------------------------------
Expand Down

0 comments on commit d0600f0

Please sign in to comment.