[versions]
kotlin = "2.3.21"
coroutines = "1.11.0"
serialization = "1.11.0"
jvmTarget = "21"
okhttp = "5.3.2" # Major version is locked by Tachiyomi extensions
javalin = "7.2.2"
jte = "3.2.4"
jackson = "3.1.3" # jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
exposed = "1.2.0"
dex2jar = "2.4.36"
polyglot = "25.0.3"
settings = "1.3.0"
twelvemonkeys = "3.13.1"
graphqlkotlin = "10.0.0-alpha.3"
xmlserialization = "0.91.3"
ktlint = "1.8.0"
koin = "4.2.1"
moko = "0.26.4"

[libraries]
# Kotlin
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin" }

# Coroutines
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines" }
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }

# Serialization
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
serialization-json-okio = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-okio", version.ref = "serialization" }
serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization" }
serialization-xml-core = { module = "io.github.pdvrieze.xmlutil:core", version.ref = "xmlserialization" }
serialization-xml = { module = "io.github.pdvrieze.xmlutil:serialization-jvm", version.ref = "xmlserialization" }

# Logging
slf4japi = "org.slf4j:slf4j-api:2.0.18"
logback = "ch.qos.logback:logback-classic:1.5.32"
kotlinlogging = "io.github.oshai:kotlin-logging-jvm:8.0.02"

# OkHttp
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp" }
okhttp-brotli = { module = "com.squareup.okhttp3:okhttp-brotli", version.ref = "okhttp" }
okio = "com.squareup.okio:okio:3.17.0"

# Javalin api
javalin-core = { module = "io.javalin:javalin", version.ref = "javalin" }
javalin-openapi = { module = "io.javalin:javalin-openapi", version.ref = "javalin" }
javalin-rendering = { module = "io.javalin:javalin-rendering-jte", version.ref = "javalin" }
jackson-databind = { module = "tools.jackson.core:jackson-databind", version.ref = "jackson" }
jackson-kotlin = { module = "tools.jackson.module:jackson-module-kotlin", version.ref = "jackson" }
jackson-annotations = "com.fasterxml.jackson.core:jackson-annotations:2.21"
jte = { module = "gg.jte:jte", version.ref = "jte" }
kte = { module = "gg.jte:jte-kotlin", version.ref = "jte" }

# GraphQL
graphql-kotlin-server = { module = "com.expediagroup:graphql-kotlin-server", version.ref = "graphqlkotlin" }
graphql-kotlin-scheme = { module = "com.expediagroup:graphql-kotlin-schema-generator", version.ref = "graphqlkotlin" }
graphql-java-scalars = "com.graphql-java:graphql-java-extended-scalars:22.0"

# Exposed ORM
exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed" }
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }
exposed-javatime = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" }
exposed-kotlintime = { module = "org.jetbrains.exposed:exposed-kotlin-datetime", version.ref = "exposed" }
postgres = "org.postgresql:postgresql:42.7.11"
h2 = "com.h2database:h2:2.4.240"
hikaricp = "com.zaxxer:HikariCP:7.0.2"

# Exposed Migrations
exposed-migrations = "com.github.Suwayomi:exposed-migrations:3.10.1"

# Dependency Injection
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }

# tray icon
systemtray-core = "com.dorkbox:SystemTray:4.4"
systemtray-utils = "com.dorkbox:Utilities:1.46" # version locked by SystemTray
systemtray-desktop = "com.dorkbox:Desktop:1.1" # version locked by SystemTray

# dependencies of Tachiyomi extensions
injekt = "com.github.null2264:injekt-koin:ee267b2e27"
rxjava = "io.reactivex:rxjava:1.3.8"
jsoup = "org.jsoup:jsoup:1.22.2"

# Config
config = "com.typesafe:config:1.4.8"
config4k = "io.github.config4k:config4k:0.7.0"

# Sort
sort = "com.github.gpanther:java-nat-sort:natural-comparator-1.1"

# Android stub library
android-stubs = "com.github.Suwayomi:android-jar:1.0.0"

# Asm modificiation
asm = "org.ow2.asm:asm:9.9.1" # version locked by Dex2Jar
dex2jar-translator = { module = "de.femtopedia.dex2jar:dex-translator", version.ref = "dex2jar" }
dex2jar-tools = { module = "de.femtopedia.dex2jar:dex-tools", version.ref = "dex2jar" }

# APK
apk-parser = "net.dongliu:apk-parser:2.6.10"
apksig = "com.android.tools.build:apksig:9.2.1"

# Xml
xmlpull = "xmlpull:xmlpull:1.1.3.4a"

# Disk & File
appdirs = "ca.gosyer:kotlin-multiplatform-appdirs:2.0.0"
cache4k = "io.github.reactivecircus.cache4k:cache4k:0.14.0"
zip4j = "net.lingala.zip4j:zip4j:2.11.6"
commonscompress = "org.apache.commons:commons-compress:1.28.0"
junrar = "com.github.junrar:junrar:7.6.0"

# AES/CBC/PKCS7Padding Cypher provider
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.84"

# AndroidX annotations
android-annotations = "androidx.annotation:annotation:1.10.0"

# Substitute for duktape-android
polyglot-core = { module = "org.graalvm.polyglot:polyglot", version.ref = "polyglot" }
polyglot-graaljs = { module = "org.graalvm.polyglot:js-community", version.ref = "polyglot" }

# Settings
settings-core = { module = "com.russhwolf:multiplatform-settings-jvm", version.ref = "settings" }
settings-serialization = { module = "com.russhwolf:multiplatform-settings-serialization-jvm", version.ref = "settings" }

# ICU4J
icu4j = "com.ibm.icu:icu4j:78.3"

# Image Decoding implementation provider
twelvemonkeys-common-lang = { module = "com.twelvemonkeys.common:common-lang", version.ref = "twelvemonkeys" }
twelvemonkeys-common-io = { module = "com.twelvemonkeys.common:common-io", version.ref = "twelvemonkeys" }
twelvemonkeys-common-image = { module = "com.twelvemonkeys.common:common-image", version.ref = "twelvemonkeys" }
twelvemonkeys-imageio-core = { module = "com.twelvemonkeys.imageio:imageio-core", version.ref = "twelvemonkeys" }
twelvemonkeys-imageio-metadata = { module = "com.twelvemonkeys.imageio:imageio-metadata", version.ref = "twelvemonkeys" }
twelvemonkeys-imageio-jpeg = { module = "com.twelvemonkeys.imageio:imageio-jpeg", version.ref = "twelvemonkeys" }
twelvemonkeys-imageio-webp = { module = "com.twelvemonkeys.imageio:imageio-webp", version.ref = "twelvemonkeys" }

imageio-webp = "com.github.usefulness:webp-imageio:0.10.2"

# Testing
mockk = "io.mockk:mockk:1.14.9"

# cron scheduler
cron4j = "it.sauronsoftware.cron4j:cron4j:2.2.5"

# cron-utils
cronUtils = "com.cronutils:cron-utils:9.2.1"

# Webview
kcef = "dev.datlag:kcef:2024.04.20.4"

# User
jwt = "com.auth0:java-jwt:4.5.2"

# lint - used for renovate to update ktlint version
ktlint = { module = "com.pinterest.ktlint:ktlint-cli", version.ref = "ktlint" }

# moko
moko = { module = "dev.icerock.moko:resources", version.ref = "moko" }

[plugins]
# Kotlin
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin"}
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin"}
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin"}

# Linter
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "14.2.0"}

# Build config
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "6.0.9"}

# Download
download = { id = "de.undercouch.download", version = "5.7.0"}

# ShadowJar
shadowjar = { id = "com.gradleup.shadow", version = "8.3.10"}

# Moko
moko = { id = "dev.icerock.mobile.multiplatform-resources", version.ref = "moko" }

# JTE
jte = { id = "gg.jte.gradle", version.ref = "jte" }

[bundles]
shared = [
    "kotlin-stdlib-jdk8",
    "kotlin-reflect",
    "coroutines-core",
    "coroutines-jdk8",
    "serialization-json",
    "serialization-json-okio",
    "serialization-protobuf",
    "koin-core",
    "slf4japi",
    "logback",
    "kotlinlogging",
    "appdirs",
    "rxjava",
    "jsoup",
    "config",
    "config4k",
    "dex2jar-translator",
    "dex2jar-tools",
    "apk-parser",
    "jackson-annotations",
    "kcef"
]

sharedTest = [
    "kotlin-test-junit5",
    "coroutines-test",
]

okhttp = [
    "okhttp-core",
    "okhttp-logging",
    "okhttp-dnsoverhttps",
    "okhttp-brotli",
]
javalin = [
    "javalin-core",
    #"javalin-openapi",
    "javalin-rendering",
    "jte",
]
jackson = [
    "jackson-databind",
    "jackson-kotlin",
    "jackson-annotations",
]
exposed = [
    "exposed-core",
    "exposed-dao",
    "exposed-jdbc",
    "exposed-javatime",
    "exposed-kotlintime",
]
systemtray = [
    "systemtray-core",
    "systemtray-utils",
    "systemtray-desktop"
]
polyglot = [
    "polyglot-core",
    "polyglot-graaljs",
]
settings = [
    "settings-core",
    "settings-serialization",
]
twelvemonkeys = [
    "twelvemonkeys-common-lang",
    "twelvemonkeys-common-io",
    "twelvemonkeys-common-image",
    "twelvemonkeys-imageio-core",
    "twelvemonkeys-imageio-metadata",
    "twelvemonkeys-imageio-jpeg",
    "twelvemonkeys-imageio-webp",
]
