build.gradle.kts 1.75 KB
// distribution — assembles the runnable vibe_erp fat-jar.
//
// This module is the only one that pulls every PBC and platform module
// together into a bootable Spring Boot application. It is referenced by
// the Dockerfile (stage 1) which produces the shipping image documented
// in the architecture spec, sections 10 and 11.

plugins {
    alias(libs.plugins.kotlin.jvm)
    alias(libs.plugins.kotlin.spring)
    alias(libs.plugins.spring.boot)
    alias(libs.plugins.spring.dependency.management)
}

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

dependencies {
    implementation(project(":platform:platform-bootstrap"))
    implementation(project(":platform:platform-persistence"))
    implementation(project(":platform:platform-plugins"))
    implementation(project(":pbc:pbc-identity"))

    implementation(libs.spring.boot.starter)
    implementation(libs.spring.boot.starter.web)
    implementation(libs.spring.boot.starter.data.jpa)
    implementation(libs.spring.boot.starter.actuator)
    implementation(libs.kotlin.stdlib)
    implementation(libs.kotlin.reflect)
    implementation(libs.jackson.module.kotlin)
    runtimeOnly(libs.postgres)
    runtimeOnly(libs.liquibase.core)

    testImplementation(libs.spring.boot.starter.test)
}

// The fat-jar produced here is what the Dockerfile copies into the
// runtime image as /app/vibe-erp.jar.
tasks.bootJar {
    mainClass.set("org.vibeerp.platform.bootstrap.VibeErpApplicationKt")
    archiveFileName.set("vibe-erp.jar")
}

// `./gradlew :distribution:bootRun` — used by `make run` for local dev.
// Activates the dev profile so application-dev.yaml on the classpath is
// layered on top of application.yaml.
tasks.bootRun {
    systemProperty("spring.profiles.active", "dev")
}