Skip to content

Commit 6b6b926

Browse files
committed
Migrate to zio-lmdb 2
Update various dependencies
1 parent e872ce6 commit 6b6b926

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

build.sbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ scalaVersion := "3.6.4"
99
scalacOptions += "-Xkind-projector:underscores"
1010

1111
lazy val versions = new {
12-
val sttp = "3.10.3"
13-
val zio = "2.1.16"
12+
val sttp = "3.11.0"
13+
val zio = "2.1.17"
1414
val zionio = "2.0.2"
1515
val zioproc = "0.7.2"
1616
val zioconfig = "4.0.4"
1717
val ziologging = "2.5.0"
18-
val ziolmdb = "1.8.4"
18+
val ziolmdb = "2.0.1"
1919
val naturalsort = "1.0.7"
2020
val jgit = "7.2.0.202503040940-r"
2121
}

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
22
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
33
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")
4-
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3")
4+
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
55
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.11.1")
66
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.2")
77
addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.8")

src/main/scala/fr/janalyse/cem/model/CodeExample.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import fr.janalyse.cem.FileSystemService
1919
import fr.janalyse.cem.tools.*
2020
import fr.janalyse.cem.tools.Hashes.sha1
2121
import zio.*
22-
import zio.lmdb.*
22+
import zio.lmdb.*, zio.lmdb.json.*
2323
import zio.nio.charset.Charset
2424
import zio.nio.file.*
2525
import zio.json.*
@@ -63,20 +63,20 @@ case class CodeExample(
6363
updatedCount: Option[Int] = None, // computed from GIT history
6464
attachments: Map[String, String] = Map.empty, // embedded
6565
lastSeen: Option[OffsetDateTime] = None // last seen/used date, useful for database garbage collection purposes
66-
) {
66+
) derives LMDBCodecJson {
6767
def fileExtension: String = filename.split("[.]", 2).drop(1).headOption.getOrElse("")
6868
def isTestable: Boolean = keywords.contains("@testable")
6969
def isExclusive: Boolean = keywords.contains("@exclusive") // exclusive examples are executed sequentially
7070
def shouldFail: Boolean = keywords.contains("@fail")
71-
def isPublishable: Boolean = !publish.isEmpty
71+
def isPublishable: Boolean = publish.nonEmpty
7272
override def toString: String = s"$category $filename $uuid $summary"
7373
}
7474

7575
object CodeExample {
7676
given JsonEncoder[Path] = JsonEncoder[String].contramap(p => p.toString)
7777
given JsonDecoder[Path] = JsonDecoder[String].map(p => Path(p))
78-
given JsonDecoder[CodeExample] = DeriveJsonDecoder.gen
79-
given JsonEncoder[CodeExample] = DeriveJsonEncoder.gen
78+
//given JsonDecoder[CodeExample] = DeriveJsonDecoder.gen
79+
//given JsonEncoder[CodeExample] = DeriveJsonEncoder.gen
8080

8181
def exampleContentExtractValue(from: String, key: String): Option[String] = {
8282
val RE = ("""(?m)(?i)^(?:(?:// )|(?:## )|(?:- )|(?:-- )) *""" + key + """ *: *(.*)$""").r

src/main/scala/fr/janalyse/cem/model/CodeExampleMetaData.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package fr.janalyse.cem.model
22

33
import fr.janalyse.cem.tools.GitMetaData
44
import zio.json.*
5+
import zio.lmdb.json.LMDBCodecJson
56

67
import java.time.OffsetDateTime
78

89
case class CodeExampleMetaData(
910
gitMetaData: Option[GitMetaData],
1011
metaDataFileContentHash: String,
11-
metaDataLastUsed: OffsetDateTime // last seen/used date, usefull for database garbage collection purposes
12-
) derives JsonCodec
12+
metaDataLastUsed: OffsetDateTime // last seen/used date, useful for database garbage collection purposes
13+
) derives LMDBCodecJson

src/main/scala/fr/janalyse/cem/model/RunStatus.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package fr.janalyse.cem.model
22

33
import zio.json.*
4+
import zio.lmdb.json.LMDBCodecJson
5+
46
import java.util.UUID
57
import java.time.OffsetDateTime
68

@@ -15,5 +17,5 @@ case class RunStatus(
1517
success: Boolean,
1618
timeout: Boolean,
1719
runState: String
18-
) derives JsonCodec
20+
) derives LMDBCodecJson
1921

0 commit comments

Comments
 (0)