feat(build): Refactor infrastructure modules and establish single source of truth
This commit introduces a major refactoring of the build system and the core infrastructure modules. The primary goal is to establish a strict "Single Source of Truth" for all dependencies using Gradle Version Catalogs and to create a clean, maintainable, and scalable foundation for all current and future services. ### 1. Centralized Dependency Management (`libs.versions.toml`) - **Established Single Source of Truth:** All dependency versions are now exclusively managed in `gradle/libs.versions.toml`. Hardcoded versions have been removed from all build scripts. - **Introduced Gradle Bundles:** To simplify module dependencies, several bundles have been created (e.g., `testing-jvm`, `redis-cache`, `spring-cloud-gateway`, `monitoring-client`). This drastically reduces boilerplate in the `build.gradle.kts` files and improves readability. - **Cleaned up Aliases:** All library and plugin aliases have been standardized for consistency. ### 2. Infrastructure Module Refactoring All infrastructure modules (`core`, `platform`, `auth`, `cache`, `event-store`, `messaging`, `monitoring`, `gateway`) have been refactored to align with the new dependency management strategy. - **Simplified Build Scripts:** The `build.gradle.kts` for each module now uses the new bundles and aliases, making them significantly cleaner and easier to understand. - **Consistent Structure:** The architecture of each module now clearly follows the Port-Adapter pattern where applicable (e.g., `cache-api`/`redis-cache`). - **Standardized `platform-bom`:** The project's own Bill of Materials (`platform-bom`) now also includes the Spring Cloud BOM, ensuring version consistency for all Spring-related dependencies. ### 3. Added Infrastructure Documentation To improve onboarding and architectural understanding, a dedicated `README-*.md` file has been created for each refactored infrastructure module: - `README-CORE.md` - `README-PLATFORM.md` - `README-INFRA-AUTH.md` - `README-INFRA-CACHE.md` - `README-INFRA-EVENT-STORE.md` - `README-INFRA-MESSAGING.md` - `README-INFRA-MONITORING.md` - `README-INFRA-GATEWAY.md` These documents explain the purpose, architecture, and usage of each component within the system. This lays the groundwork for our "Tracer Bullet" development approach.
This commit is contained in:
@@ -1,26 +1,21 @@
|
||||
plugins {
|
||||
// KORREKTUR: 'java-library' und 'kotlin("jvm")' ersetzen
|
||||
/*plugins {
|
||||
alias(libs.plugins.kotlin.multiplatform)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
// KORREKTUR: JVM- und JS-Ziele definieren
|
||||
jvm()
|
||||
js(IR) {
|
||||
browser()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
// Diese Abhängigkeiten sind für alle Plattformen (JVM, JS) verfügbar
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
// Die 'kotlin("test")'-Abhängigkeit ist der Standardweg für KMP-Tests
|
||||
implementation(kotlin("test"))
|
||||
api(libs.kotlinx.coroutines.test)
|
||||
}
|
||||
}
|
||||
|
||||
// Diese Abhängigkeiten sind NUR für die JVM-Tests verfügbar
|
||||
val jvmTest by getting {
|
||||
dependencies {
|
||||
api(libs.junit.jupiter.api)
|
||||
@@ -28,7 +23,6 @@ kotlin {
|
||||
api(libs.junit.jupiter.params)
|
||||
api(libs.junit.platform.launcher)
|
||||
|
||||
// KORREKTUR: Alle hartcodierten Versionen durch Aliase ersetzen
|
||||
api(libs.mockk)
|
||||
api(libs.assertj.core)
|
||||
api(libs.spring.boot.starter.test)
|
||||
@@ -40,4 +34,24 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Dieses Modul bündelt alle für JVM-Tests notwendigen Abhängigkeiten.
|
||||
// Jedes Modul, das Tests enthält, sollte dieses Modul mit `testImplementation` einbinden.
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Importiert die zentrale BOM für konsistente Versionen.
|
||||
api(platform(projects.platform.platformBom))
|
||||
|
||||
// OPTIMIERUNG: Verwendung von Bundles, um die Konfiguration zu vereinfachen.
|
||||
// Diese Bundles sind in `libs.versions.toml` definiert.
|
||||
api(libs.bundles.testing.jvm)
|
||||
api(libs.bundles.testcontainers)
|
||||
|
||||
// Einzelne Test-Abhängigkeiten, die nicht in den Haupt-Bundles enthalten sind.
|
||||
api(libs.spring.boot.starter.test)
|
||||
api(libs.h2.driver) // H2 wird oft für In-Memory-Tests benötigt.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user