build.gradle.kts 1.97 KB
plugins {
    alias(libs.plugins.kotlin.jvm)
    alias(libs.plugins.kotlin.spring)
    alias(libs.plugins.kotlin.jpa)
    alias(libs.plugins.spring.dependency.management)
}

description = "vibe_erp pbc-identity — users, roles, tenants, permissions. INTERNAL Packaged Business Capability."

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(21))
    }
}

kotlin {
    jvmToolchain(21)
    compilerOptions {
        freeCompilerArgs.add("-Xjsr305=strict")
    }
}

allOpen {
    annotation("jakarta.persistence.Entity")
    annotation("jakarta.persistence.MappedSuperclass")
    annotation("jakarta.persistence.Embeddable")
}

// CRITICAL: pbc-identity may depend on api-v1 and platform-* runtime modules
// (persistence, plugins, i18n, etc.) but NEVER on platform-bootstrap, and
// NEVER on another pbc-*.
//
//   • No cross-PBC: enforced by the root build.gradle.kts.
//   • No dependency on platform-bootstrap: bootstrap is the application
//     entry point that ASSEMBLES PBCs at the top of the stack. Depending
//     on it inverts the layering — every change to the HTTP filter or the
//     properties bean would force a recompile of every PBC, and a future
//     PBC graph would tangle into an unfixable cycle.
dependencies {
    api(project(":api:api-v1"))
    implementation(project(":platform:platform-persistence"))

    implementation(libs.kotlin.stdlib)
    implementation(libs.kotlin.reflect)

    implementation(libs.spring.boot.starter)
    implementation(libs.spring.boot.starter.web)
    implementation(libs.spring.boot.starter.data.jpa)
    implementation(libs.spring.boot.starter.validation)
    implementation(libs.jackson.module.kotlin)

    testImplementation(libs.spring.boot.starter.test)
    testImplementation(libs.junit.jupiter)
    testImplementation(libs.assertk)
    testImplementation(libs.mockk)
    testImplementation(libs.testcontainers.postgres)
    testImplementation(libs.testcontainers.junit.jupiter)
}

tasks.test {
    useJUnitPlatform()
}