Skip to content

Commit

Permalink
Adds a scala gradle module where.. (#19)
Browse files Browse the repository at this point in the history
will be placing the scala version of the library. Later on the amount of dependencies will be reduced according to the kotlin migration
juanpedromoreno authored May 2, 2023
1 parent bb3d9e0 commit 1e754a4
Showing 4 changed files with 74 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -20,3 +20,5 @@ systemProp.org.gradle.unsafe.kotlin.assignment=true

# Workaround to disable Dokka setup from Arrow Gradle Config
dokkaEnabled=false

scalaVersions = 3.2.2
34 changes: 34 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -17,6 +17,18 @@ testcontainers = "1.17.6"
hikari = "5.0.1"
dokka = "1.8.10"
logback = "1.4.6"
scalaMultiversion = "2.0.4"
ciris = "3.1.0"
http4s = "0.23.18"
circe = "0.14.4"
catsEffect = "3.4.8"
log4cats = "2.5.0"
catsRetry = "3.1.0"
memeid4cats = "0.8.0"
doobie = "1.0.0-RC2"
scalaTestContainers = "0.40.10"
munit = "0.7.28"
munitCatsEffect = "1.0.5"

[libraries]
arrow-core = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" }
@@ -45,6 +57,27 @@ hikari = { module = "com.zaxxer:HikariCP", version.ref = "hikari" }
postgresql = { module = "org.postgresql:postgresql", version.ref = "postgresql" }
testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "testcontainers" }
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
ciris-core = { module = "is.cir:ciris_%%", version.ref = "ciris" }
ciris-refined = { module = "is.cir:ciris-refined_%%", version.ref = "ciris" }
ciris-http4s = { module = "is.cir:ciris-http4s_%%", version.ref = "ciris" }
http4s-dsl = { module = "org.http4s:http4s-dsl_%%", version.ref = "http4s" }
http4s-client = { module = "org.http4s:http4s-client_%%", version.ref = "http4s" }
http4s-circe = { module = "org.http4s:http4s-circe_%%", version.ref = "http4s" }
http4s-emberClient = { module = "org.http4s:http4s-ember-client_%%", version.ref = "http4s" }
doobie-core = { module = "org.tpolecat:doobie-core_%%", version.ref = "doobie" }
doobie-postgres = { module = "org.tpolecat:doobie-postgres_%%", version.ref = "doobie" }
doobie-hikari = { module = "org.tpolecat:doobie-hikari_%%", version.ref = "doobie" }
doobie-munit = { module = "org.tpolecat:doobie-munit_%%", version.ref = "doobie" }
circe = { module = "io.circe:circe-generic_%%", version.ref = "circe" }
cats-effect = { module = "org.typelevel:cats-effect_%%", version.ref = "catsEffect" }
logger = { module = "org.typelevel:log4cats-slf4j_%%", version.ref = "log4cats" }
openai = { module = "com.theokanning.openai-gpt3-java:service_%%", version.ref = "openai" }
cats-retry = { module = "com.github.cb372:cats-retry_%%", version.ref = "catsRetry" }
memeid = { module = "com.47deg:memeid4s-cats_%%", version.ref = "memeid4cats" }
munit-core = { module = "org.scalameta:munit_%%", version.ref = "munit" }
munit-cats-effect = { module = "org.typelevel:munit-cats-effect-3_%%", version.ref = "munitCatsEffect" }
scala-testcontainers-munit = { module = "com.dimafeng:testcontainers-scala-munit_%%", version.ref = "scalaTestContainers" }
scala-testcontainers-postgresql = { module = "com.dimafeng:testcontainers-scala-postgresql_%%", version.ref = "scalaTestContainers" }

[bundles]
arrow = [
@@ -67,3 +100,4 @@ spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
arrow-gradle-nexus = { id = "io.arrow-kt.arrow-gradle-config-nexus", version.ref = "arrowGradle" }
arrow-gradle-publish = { id = "io.arrow-kt.arrow-gradle-config-publish", version.ref = "arrowGradle" }
scala-multiversion = { id = "com.adtran.scala-multiversion-plugin", version.ref = "scalaMultiversion" }
34 changes: 34 additions & 0 deletions scala/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@file:Suppress("DSL_SCOPE_VIOLATION")

plugins {
scala
alias(libs.plugins.scala.multiversion)
}

dependencies {
implementation(libs.ciris.core)
implementation(libs.ciris.refined)
implementation(libs.ciris.http4s)
implementation(libs.http4s.dsl)
implementation(libs.http4s.client)
implementation(libs.http4s.circe)
implementation(libs.http4s.emberClient)
implementation(libs.doobie.core)
implementation(libs.doobie.postgres)
implementation(libs.doobie.hikari)
implementation(libs.doobie.munit)
implementation(libs.circe)
implementation(libs.cats.effect)
implementation(libs.logger)
implementation(libs.openai)
implementation(libs.cats.retry)
implementation(libs.memeid)
testImplementation(libs.munit.core)
testImplementation(libs.munit.cats.effect)
testImplementation(libs.scala.testcontainers.munit)
testImplementation(libs.scala.testcontainers.postgresql)
}

tasks.withType<Test>().configureEach {
useJUnit()
}
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -8,3 +8,7 @@ pluginManagement {
rootProject.name = "langchain4k"
include("nodejs-commandexecutor")
include("example")


include("langchain4k-scala")
project(":langchain4k-scala").projectDir = file("scala")

0 comments on commit 1e754a4

Please sign in to comment.