fixing Tracer-Bullet_Backend-Infrastruktur
This commit is contained in:
+38
-50
@@ -1,45 +1,60 @@
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
// Defines plugins that are available to all subprojects.
|
|
||||||
// `apply false` means the plugin is not applied to the root project itself.
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlin.jvm) apply false
|
alias(libs.plugins.kotlin.jvm) apply false
|
||||||
alias(libs.plugins.kotlin.multiplatform) apply false
|
alias(libs.plugins.spring.boot) apply false
|
||||||
alias(libs.plugins.compose.multiplatform) apply false
|
alias(libs.plugins.spring.dependencyManagement) apply false
|
||||||
alias(libs.plugins.compose.compiler) apply false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common configuration for all subprojects in this build.
|
|
||||||
subprojects {
|
subprojects {
|
||||||
// Enforce Java 21 for all Kotlin compilation tasks.
|
|
||||||
|
// Wende gemeinsame Einstellungen an
|
||||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||||
compilerOptions {
|
compilerOptions {
|
||||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure all test tasks to use the JUnit Platform (for JUnit 5).
|
|
||||||
tasks.withType<Test>().configureEach {
|
tasks.withType<Test>().configureEach {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documentation generation tasks
|
// ##################################################################
|
||||||
|
// ### IHRE DOKUMENTATIONS-TASKS ###
|
||||||
|
// ##################################################################
|
||||||
|
|
||||||
|
// Abstrakte Klasse für die Custom Task (Best Practice)
|
||||||
|
abstract class ValidateDocumentationTask @Inject constructor(
|
||||||
|
private val execOperations: ExecOperations
|
||||||
|
) : DefaultTask() {
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
fun validate() {
|
||||||
|
println("🔍 Validating documentation...")
|
||||||
|
execOperations.exec {
|
||||||
|
commandLine("./scripts/validation/validate-docs.sh")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Registrierung der Tasks
|
||||||
|
tasks.register<ValidateDocumentationTask>("validateDocumentation") {
|
||||||
|
description = "Validates documentation completeness and consistency"
|
||||||
|
group = "documentation"
|
||||||
|
}
|
||||||
|
|
||||||
tasks.register("generateOpenApiDocs") {
|
tasks.register("generateOpenApiDocs") {
|
||||||
description = "Generates OpenAPI documentation from all API modules"
|
description = "Generates OpenAPI documentation from all API modules"
|
||||||
group = "documentation"
|
group = "documentation"
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
println("🔧 Generating OpenAPI documentation...")
|
println("🔧 Generating OpenAPI documentation...")
|
||||||
|
|
||||||
val apiModules = listOf(
|
val apiModules = listOf(
|
||||||
"members:members-api",
|
"members:members-api",
|
||||||
"horses:horses-api",
|
"horses:horses-api",
|
||||||
"events:events-api",
|
"events:events-api",
|
||||||
"masterdata:masterdata-api"
|
"masterdata:masterdata-api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create docs/api/generated directory
|
|
||||||
val outputDir = file("docs/api/generated")
|
val outputDir = file("docs/api/generated")
|
||||||
outputDir.mkdirs()
|
outputDir.mkdirs()
|
||||||
|
|
||||||
@@ -47,72 +62,45 @@ tasks.register("generateOpenApiDocs") {
|
|||||||
val moduleName = module.split(":").last().replace("-api", "")
|
val moduleName = module.split(":").last().replace("-api", "")
|
||||||
println("📝 Processing $moduleName API...")
|
println("📝 Processing $moduleName API...")
|
||||||
|
|
||||||
// Generate OpenAPI spec for each module
|
|
||||||
val specFile = file("$outputDir/${moduleName}-openapi.json")
|
val specFile = file("$outputDir/${moduleName}-openapi.json")
|
||||||
specFile.writeText("""
|
specFile.writeText(
|
||||||
|
"""
|
||||||
{
|
{
|
||||||
"openapi": "3.0.3",
|
"openapi": "3.0.3",
|
||||||
"info": {
|
"info": {
|
||||||
"title": "${moduleName.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }} API",
|
"title": "${moduleName.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }} API",
|
||||||
"description": "REST API for ${moduleName} management",
|
"description": "REST API for $moduleName management",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"contact": {
|
"contact": {
|
||||||
"name": "Meldestelle Development Team"
|
"name": "Meldestelle Development Team"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{ "url": "http://localhost:8080", "description": "Development server" },
|
||||||
"url": "http://localhost:8080",
|
{ "url": "https://api.meldestelle.at", "description": "Production server" }
|
||||||
"description": "Development server"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://api.meldestelle.at",
|
|
||||||
"description": "Production server"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"paths": {},
|
"paths": {},
|
||||||
"components": {
|
"components": {
|
||||||
"securitySchemes": {
|
"securitySchemes": {
|
||||||
"bearerAuth": {
|
"bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" }
|
||||||
"type": "http",
|
|
||||||
"scheme": "bearer",
|
|
||||||
"bearerFormat": "JWT"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security": [
|
"security": [ { "bearerAuth": [] } ]
|
||||||
{
|
|
||||||
"bearerAuth": []
|
|
||||||
}
|
}
|
||||||
]
|
""".trimIndent()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
""".trimIndent())
|
|
||||||
}
|
|
||||||
|
|
||||||
println("✅ OpenAPI documentation generated in docs/api/generated/")
|
println("✅ OpenAPI documentation generated in docs/api/generated/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("validateDocumentation") {
|
|
||||||
description = "Validates documentation completeness and consistency"
|
|
||||||
group = "documentation"
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
println("🔍 Validating documentation...")
|
|
||||||
exec {
|
|
||||||
commandLine("./scripts/validation/validate-docs.sh")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register("generateAllDocs") {
|
tasks.register("generateAllDocs") {
|
||||||
description = "Generates all documentation (API docs + validation)"
|
description = "Generates all documentation (API docs + validation)"
|
||||||
group = "documentation"
|
group = "documentation"
|
||||||
|
|
||||||
dependsOn("generateOpenApiDocs", "validateDocumentation")
|
dependsOn("generateOpenApiDocs", "validateDocumentation")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapper task configuration for the root project
|
// Wrapper-Konfiguration
|
||||||
tasks.wrapper {
|
tasks.wrapper {
|
||||||
gradleVersion = "8.14"
|
gradleVersion = "8.14"
|
||||||
distributionType = Wrapper.DistributionType.BIN
|
distributionType = Wrapper.DistributionType.BIN
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<configuration>
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<logger name="at.mocode" level="debug" additivity="false">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
</logger>
|
||||||
|
</configuration>
|
||||||
@@ -50,7 +50,7 @@ testcontainers = "1.19.6"
|
|||||||
# --- Utilities ---
|
# --- Utilities ---
|
||||||
uuid = "0.8.4"
|
uuid = "0.8.4"
|
||||||
bignum = "0.3.9"
|
bignum = "0.3.9"
|
||||||
logback = "1.5.6"
|
logback = "1.5.13"
|
||||||
caffeine = "3.1.8"
|
caffeine = "3.1.8"
|
||||||
reactorKafka = "1.3.22"
|
reactorKafka = "1.3.22"
|
||||||
jackson = "2.17.0"
|
jackson = "2.17.0"
|
||||||
|
|||||||
@@ -1,34 +1,3 @@
|
|||||||
/*
|
|
||||||
// Multiplatform
|
|
||||||
plugins {
|
|
||||||
alias(libs.plugins.kotlin.multiplatform)
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvm()
|
|
||||||
js(IR) {
|
|
||||||
browser()
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
val commonMain by getting {
|
|
||||||
dependencies {
|
|
||||||
api(libs.kotlinx.coroutines.core)
|
|
||||||
api(libs.kotlinx.serialization.json)
|
|
||||||
api(libs.kotlinx.datetime)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val jvmMain by getting {
|
|
||||||
dependencies {
|
|
||||||
api(libs.kotlin.logging.jvm)
|
|
||||||
api(libs.kotlinx.coroutines.reactor)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Dieses Modul ist ein reines "Sammelmodul".
|
// Dieses Modul ist ein reines "Sammelmodul".
|
||||||
// Es hat keinen eigenen Code, sondern bündelt nur gemeinsame Laufzeit-Abhängigkeiten,
|
// Es hat keinen eigenen Code, sondern bündelt nur gemeinsame Laufzeit-Abhängigkeiten,
|
||||||
// die von den meisten JVM-Modulen benötigt werden.
|
// die von den meisten JVM-Modulen benötigt werden.
|
||||||
@@ -47,4 +16,5 @@ dependencies {
|
|||||||
api(libs.kotlinx.datetime)
|
api(libs.kotlinx.datetime)
|
||||||
api(libs.kotlin.logging.jvm)
|
api(libs.kotlin.logging.jvm)
|
||||||
api(libs.kotlinx.coroutines.reactor)
|
api(libs.kotlinx.coroutines.reactor)
|
||||||
|
api(libs.logback.classic)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +1,3 @@
|
|||||||
/*
|
|
||||||
plugins {
|
|
||||||
alias(libs.plugins.kotlin.multiplatform)
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvm()
|
|
||||||
js(IR) {
|
|
||||||
browser()
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
val commonTest by getting {
|
|
||||||
dependencies {
|
|
||||||
implementation(kotlin("test"))
|
|
||||||
api(libs.kotlinx.coroutines.test)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val jvmTest by getting {
|
|
||||||
dependencies {
|
|
||||||
api(libs.junit.jupiter.api)
|
|
||||||
api(libs.junit.jupiter.engine)
|
|
||||||
api(libs.junit.jupiter.params)
|
|
||||||
api(libs.junit.platform.launcher)
|
|
||||||
|
|
||||||
api(libs.mockk)
|
|
||||||
api(libs.assertj.core)
|
|
||||||
api(libs.spring.boot.starter.test)
|
|
||||||
api(libs.h2.driver)
|
|
||||||
|
|
||||||
api(libs.testcontainers.core)
|
|
||||||
api(libs.testcontainers.junit.jupiter)
|
|
||||||
api(libs.testcontainers.postgresql)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Dieses Modul bündelt alle für JVM-Tests notwendigen Abhängigkeiten.
|
// Dieses Modul bündelt alle für JVM-Tests notwendigen Abhängigkeiten.
|
||||||
// Jedes Modul, das Tests enthält, sollte dieses Modul mit `testImplementation` einbinden.
|
// Jedes Modul, das Tests enthält, sollte dieses Modul mit `testImplementation` einbinden.
|
||||||
plugins {
|
plugins {
|
||||||
|
|||||||
Reference in New Issue
Block a user