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,30 +1,23 @@
|
||||
// Dieses Modul definiert die Kern-Domänenobjekte des Shared Kernels.
|
||||
// Es enthält keine Implementierungsdetails, nur reine Datenklassen und Enums.
|
||||
plugins {
|
||||
// KORREKTUR: Von JVM zu Multiplattform wechseln
|
||||
alias(libs.plugins.kotlin.multiplatform)
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
}
|
||||
|
||||
// KORREKTUR: Diesen Block hinzufügen, um die Ziele zu definieren
|
||||
kotlin {
|
||||
jvm()
|
||||
js(IR) {
|
||||
browser()
|
||||
}
|
||||
dependencies {
|
||||
// Stellt sicher, dass dieses Modul Zugriff auf die im zentralen Katalog
|
||||
// definierten Bibliotheken hat.
|
||||
api(projects.platform.platformDependencies)
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
// Die Abhängigkeiten kommen hier rein
|
||||
api(projects.platform.platformDependencies)
|
||||
api(libs.uuid)
|
||||
api(libs.kotlinx.serialization.json)
|
||||
api(libs.kotlinx.datetime)
|
||||
}
|
||||
}
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation(projects.platform.platformTesting)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Kern-Abhängigkeiten für das Domänen-Modell.
|
||||
// `api` wird verwendet, damit Services, die `core-domain` einbinden,
|
||||
// diese Typen ebenfalls direkt nutzen können.
|
||||
api(libs.uuid)
|
||||
api(libs.kotlinx.serialization.json)
|
||||
api(libs.kotlinx.datetime)
|
||||
|
||||
// Stellt die Test-Bibliotheken bereit.
|
||||
testImplementation(projects.platform.platformTesting)
|
||||
testImplementation(libs.bundles.testing.jvm)
|
||||
}
|
||||
|
||||
@@ -1,41 +1,34 @@
|
||||
// Dieses Modul stellt gemeinsame technische Hilfsfunktionen bereit,
|
||||
// wie z.B. Konfigurations-Management, Datenbank-Verbindungen und Service Discovery.
|
||||
plugins {
|
||||
// KORREKTUR: Von JVM zu Multiplattform wechseln
|
||||
alias(libs.plugins.kotlin.multiplatform)
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
js(IR) {
|
||||
browser()
|
||||
}
|
||||
dependencies {
|
||||
// Abhängigkeit zum platform-Modul für zentrale Versionsverwaltung
|
||||
api(projects.platform.platformDependencies)
|
||||
// Abhängigkeit zum core-domain-Modul, um dessen Typen zu verwenden
|
||||
api(projects.core.coreDomain)
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
// Diese sind plattformunabhängig und können geteilt werden
|
||||
api(projects.platform.platformDependencies)
|
||||
api(projects.core.coreDomain)
|
||||
api(libs.kotlinx.coroutines.core)
|
||||
api(libs.bignum)
|
||||
}
|
||||
}
|
||||
val jvmMain by getting {
|
||||
dependencies {
|
||||
// DIESE SIND NUR FÜR DIE JVM!
|
||||
api(libs.exposed.core)
|
||||
api(libs.exposed.dao)
|
||||
api(libs.exposed.jdbc)
|
||||
api(libs.exposed.kotlin.datetime)
|
||||
api(libs.hikari.cp)
|
||||
api(libs.flyway.core)
|
||||
api(libs.flyway.postgresql)
|
||||
api(libs.consul.client)
|
||||
}
|
||||
}
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation(projects.platform.platformTesting)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Asynchronität
|
||||
api(libs.kotlinx.coroutines.core)
|
||||
|
||||
// Datenbank-Management
|
||||
// OPTIMIERUNG: Verwendung von Bundles für Exposed und Flyway
|
||||
api(libs.bundles.exposed)
|
||||
api(libs.bundles.flyway)
|
||||
api(libs.hikari.cp)
|
||||
|
||||
// Service Discovery
|
||||
api(libs.consul.client)
|
||||
|
||||
// Logging
|
||||
api(libs.kotlin.logging.jvm)
|
||||
|
||||
// Utilities
|
||||
api(libs.bignum) // Für BigDecimal Serialisierung
|
||||
|
||||
// Testing
|
||||
testImplementation(projects.platform.platformTesting)
|
||||
testImplementation(libs.bundles.testing.jvm)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user