diff --git a/hideout-core/build.gradle.kts b/hideout-core/build.gradle.kts index e9fa5de1..03de7c16 100644 --- a/hideout-core/build.gradle.kts +++ b/hideout-core/build.gradle.kts @@ -15,13 +15,13 @@ val coroutines_version: String by project val serialization_version: String by project plugins { - kotlin("jvm") version "1.9.23" - id("io.gitlab.arturbosch.detekt") version "1.23.6" - id("org.springframework.boot") version "3.2.3" - kotlin("plugin.spring") version "1.9.23" - id("org.openapi.generator") version "7.4.0" - id("org.jetbrains.kotlinx.kover") version "0.7.6" - id("com.github.jk1.dependency-license-report") version "2.5" + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.detekt) + alias(libs.plugins.spring.boot) + alias(libs.plugins.kotlin.spring) + alias(libs.plugins.openapi.generator) + alias(libs.plugins.kover) + alias(libs.plugins.license.report) } @@ -185,47 +185,36 @@ val os = org.gradle.nativeplatform.platform.internal .DefaultNativePlatform.getCurrentOperatingSystem() dependencies { - implementation("io.ktor:ktor-serialization-jackson:$ktor_version") - implementation("org.jetbrains.exposed:exposed-core:$exposed_version") - implementation("org.jetbrains.exposed:exposed-jdbc:$exposed_version") developmentOnly("com.h2database:h2:$h2_version") - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version") - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version") + detektPlugins(libs.detekt.formatting) + implementation(libs.bundles.exposed) + implementation(libs.bundles.coroutines) + implementation(libs.bundles.ktor.client) + implementation(libs.bundles.serialization) + implementation(libs.bundles.apache.tika) + implementation(libs.bundles.openapi) + implementation(libs.bundles.kjob) + implementation(libs.bundles.spring.boot.oauth2) + implementation(libs.bundles.spring.boot.data.mongodb) + implementation(libs.bundles.spring.boot.data.mongodb) implementation("org.springframework.boot:spring-boot-starter-actuator") - implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.boot:spring-boot-starter-thymeleaf") - implementation("org.springframework.boot:spring-boot-starter-oauth2-authorization-server") - implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server") implementation("org.springframework.boot:spring-boot-starter-log4j2") implementation("org.springframework.boot:spring-boot-starter-validation") - implementation("jakarta.validation:jakarta.validation-api") - implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") - implementation("io.swagger.core.v3:swagger-annotations:2.2.6") - implementation("io.swagger.core.v3:swagger-models:2.2.6") - implementation("org.jetbrains.exposed:exposed-java-time:$exposed_version") - testImplementation("org.springframework.boot:spring-boot-starter-test") - implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin") - implementation("org.springframework.security:spring-security-oauth2-jose") - implementation("org.springframework.boot:spring-boot-starter-data-mongodb") - implementation("org.springframework.boot:spring-boot-starter-data-mongodb-reactive") - implementation("org.jetbrains.exposed:exposed-spring-boot-starter:$exposed_version") + implementation("io.trbl:blurhash:1.0.0") implementation("software.amazon.awssdk:s3:2.25.23") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$coroutines_version") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$coroutines_version") - implementation("dev.usbharu:http-signature:1.0.0") - + implementation("org.jsoup:jsoup:1.17.2") + implementation("com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20240325.1") implementation("org.postgresql:postgresql:42.7.3") implementation("com.twelvemonkeys.imageio:imageio-webp:3.10.1") - implementation("org.apache.tika:tika-core:2.9.1") - implementation("org.apache.tika:tika-parsers:2.9.1") implementation("net.coobird:thumbnailator:0.4.20") - implementation("org.bytedeco:javacv:1.5.10") { + implementation("org.flywaydb:flyway-core") + + implementation(libs.javacv) { exclude(module = "opencv") exclude(module = "flycapture") exclude(module = "artoolkitplus") @@ -237,25 +226,20 @@ dependencies { exclude(module = "libfreenect2") } if (os.isWindows) { - implementation("org.bytedeco", "ffmpeg", "6.1.1-1.5.10", classifier = "windows-x86_64") + implementation(variantOf(libs.javacv.ffmpeg) { classifier("windows-x86_64") }) } else { - implementation("org.bytedeco", "ffmpeg", "6.1.1-1.5.10", classifier = "linux-x86_64") + implementation(variantOf(libs.javacv.ffmpeg) { classifier("linux-x86_64") }) } - implementation("org.flywaydb:flyway-core") + implementation("dev.usbharu:http-signature:1.0.0") implementation("dev.usbharu:emoji-kt:2.0.0") implementation("dev.usbharu:owl-producer-default:0.0.1") - implementation("org.jsoup:jsoup:1.17.2") - implementation("com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20240325.1") - implementation("io.ktor:ktor-client-logging-jvm:$ktor_version") + testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version") - implementation("io.ktor:ktor-client-core:$ktor_version") - implementation("io.ktor:ktor-client-cio:$ktor_version") - implementation("io.ktor:ktor-client-content-negotiation:$ktor_version") testImplementation("io.ktor:ktor-client-mock:$ktor_version") testImplementation("com.h2database:h2:$h2_version") @@ -264,11 +248,6 @@ dependencies { testImplementation("nl.jqno.equalsverifier:equalsverifier:3.15.6") testImplementation("com.jparams:to-string-verifier:1.4.8") - implementation("org.drewcarlson:kjob-core:0.6.0") - implementation("org.drewcarlson:kjob-mongo:0.6.0") - - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.6") - intTestImplementation("org.springframework.boot:spring-boot-starter-test") intTestImplementation("org.springframework.security:spring-security-test") intTestImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version") @@ -337,7 +316,6 @@ project.gradle.taskGraph.whenReady { } kover { - excludeSourceSets { names("aot", "e2eTest", "intTest") } @@ -370,7 +348,6 @@ springBoot { } licenseReport { - excludeOwnGroup = true importers = arrayOf(XmlReportImporter("hideout", File("$projectDir/license-list.xml"))) diff --git a/hideout-core/settings.gradle.kts b/hideout-core/settings.gradle.kts index e0db79c9..7378ceba 100644 --- a/hideout-core/settings.gradle.kts +++ b/hideout-core/settings.gradle.kts @@ -3,4 +3,16 @@ plugins { } rootProject.name = "hideout-core" -includeBuild("../owl") \ No newline at end of file +includeBuild("../owl") + +dependencyResolutionManagement { + repositories { + mavenCentral() + } + + versionCatalogs { + create("libs") { + from(files("../libs.versions.toml")) + } + } +} \ No newline at end of file diff --git a/hideout-worker/build.gradle.kts b/hideout-worker/build.gradle.kts index 45be2756..e8ddffec 100644 --- a/hideout-worker/build.gradle.kts +++ b/hideout-worker/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "1.9.23" + alias(libs.plugins.kotlin.jvm) } group = "dev.usbharu" diff --git a/hideout-worker/settings.gradle.kts b/hideout-worker/settings.gradle.kts index 29deec55..97244032 100644 --- a/hideout-worker/settings.gradle.kts +++ b/hideout-worker/settings.gradle.kts @@ -3,3 +3,14 @@ plugins { } rootProject.name = "hideout-worker" +dependencyResolutionManagement { + repositories { + mavenCentral() + } + + versionCatalogs { + create("libs") { + from(files("../libs.versions.toml")) + } + } +} \ No newline at end of file diff --git a/libs.versions.toml b/libs.versions.toml new file mode 100644 index 00000000..acd49b5c --- /dev/null +++ b/libs.versions.toml @@ -0,0 +1,78 @@ +[versions] + +kotlin = "1.9.23" +ktor = "2.3.9" +exposed = "0.49.0" +javacv-ffmpeg = "6.1.1-1.5.10" +detekt = "1.23.5" +coroutines = "1.8.0" +swagger = "2.2.6" +serialization = "1.6.3" +kjob = "0.6.0" +tika = "2.9.1" + +[libraries] + +exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" } +exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" } +exposed-spring = { module = "org.jetbrains.exposed:exposed-spring-boot-starter", version.ref = "exposed" } +exposed-java-time = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" } + +cotoutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +cotoutines-reactor = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactor", version.ref = "coroutines" } +cotoutines-slf4j = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version.ref = "coroutines" } + +javacv = { module = "org.bytedeco:javacv", version = "1.5.10" } +javacv-ffmpeg = { module = "org.bytedeco:ffmpeg", version.ref = "javacv-ffmpeg" } + +detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } + +ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } +ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } +ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } +ktor-client-mock = { module = "io.ktor:ktor-client-client-mock", version.ref = "ktor" } +ktor-client-logging-jvm = { module = "io.ktor:ktor-client-logging-jvm", version.ref = "ktor" } +ktor-serialization-jackson = { module = "io.ktor:ktor-serialization-jackson", version.ref = "ktor" } + +spring-boot-oauth2-authorization = { module = "org.springframework.boot:spring-boot-starter-oauth2-authorization-server" } +spring-boot-oauth2-resource = { module = "org.springframework.boot:spring-boot-starter-oauth2-resource-server" } +spring-boot-oauth2-jose = { module = "org.springframework.security:spring-security-oauth2-jose" } + +spring-boot-data-mongodb = { module = "org.springframework.boot:spring-boot-starter-data-mongodb" } +spring-boot-data-mongodb-reactive = { module = "org.springframework.boot:spring-boot-starter-data-mongodb-reactive" } + +jakarta-validation = { module = "jakarta.validation:jakarta.validation-api", version = "3.0.2" } +jakarta-annotation = { module = "jakarta.annotation:jakarta.annotation-api", version = "2.1.0" } +swagger-annotations = { module = "io.swagger.core.v3:swagger-annotations", version.ref = "swagger" } +swagger-models = { module = "io.swagger.core.v3:swagger-models", version.ref = "swagger" } + +serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialization" } +serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } + +apache-tika-core = { module = "org.apache.tika:tika-core", version.ref = "tika" } +apache-tika-parsers = { module = "org.apache.tika:tika-parsers", version.ref = "tika" } + +kjon-core = { module = "org.drewcarlson:kjob-core", version.ref = "kjob" } +kjon-mongo = { module = "org.drewcarlson:kjob-mongo", version.ref = "kjob" } + +[bundles] + +exposed = ["exposed-core", "exposed-java-time", "exposed-jdbc", "exposed-spring"] +coroutines = ["cotoutines-core", "cotoutines-reactor", "cotoutines-slf4j"] +ktor-client = ["ktor-client-cio", "ktor-client-content-negotiation", "ktor-client-core", "ktor-client-logging-jvm", "ktor-serialization-jackson"] +spring-boot-oauth2 = ["spring-boot-oauth2-authorization", "spring-boot-oauth2-jose", "spring-boot-oauth2-resource"] +spring-boot-data-mongodb = ["spring-boot-data-mongodb", "spring-boot-data-mongodb-reactive"] +openapi = ["jakarta-annotation", "jakarta-validation", "swagger-annotations", "swagger-models"] +serialization = ["serialization-core", "serialization-json"] +apache-tika = ["apache-tika-core", "apache-tika-parsers"] +kjob = ["kjon-core", "kjon-mongo"] + +[plugins] + +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +spring-boot = { id = "org.springframework.boot", version = "3.2.3" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" } +kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.6" } +openapi-generator = { id = "org.openapi.generator", version = "7.4.0" } +license-report = { id = "com.github.jk1.dependency-license-report", version = "2.5" } \ No newline at end of file