build.gradle.kts 1.69 KB
plugins {
    alias(libs.plugins.kotlin.jvm)
    `java-library`
    `maven-publish`
}

description = "vibe_erp Public Plug-in API v1 — the only stable contract a plug-in is allowed to depend on."

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

kotlin {
    jvmToolchain(21)
}

// api-v1 has the strictest dependency hygiene in the entire project.
// Adding ANY dependency here is effectively adding it to every plug-in
// in the ecosystem, forever, until the next major version bump. Be paranoid.
dependencies {
    api(libs.kotlin.stdlib)
    api(libs.jakarta.validation.api)

    testImplementation(libs.junit.jupiter)
    testImplementation(libs.assertk)
}

tasks.test {
    useJUnitPlatform()
}

// We override the inherited project version (0.1.0-SNAPSHOT) with the
// independently-versioned API line, because plug-in authors track this.
version = providers.gradleProperty("vibeerp.api.version").get()

publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["java"])
            groupId = "org.vibeerp"
            artifactId = "api-v1"
            version = project.version.toString()
            pom {
                name.set("vibe_erp Public Plug-in API v1")
                description.set("Stable, semver-governed plug-in API for the vibe_erp framework.")
                url.set("https://github.com/vibeerp/vibe-erp")
                licenses {
                    license {
                        name.set("Apache License 2.0")
                        url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
                    }
                }
            }
        }
    }
}