mana-kotlin-core/build.gradle.kts
Till JS 2b7f866c8a build: Maven-Registry till/maven -> mana/maven (Namespace-Vereinheitlichung)
Kotlin-Libs liegen jetzt in der Verein-Package-Registry git.mana.how/api/packages/mana/maven
(alle 10 Libs / 50 Versionen registry-zu-registry kopiert). Consumer- und
Publisher-URLs nachgezogen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 18:05:20 +02:00

74 lines
2 KiB
Kotlin

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
`java-library`
`maven-publish`
}
group = "ev.mana"
version = "0.8.0"
dependencies {
// Öffentliche API — Konsumenten (wordeck-android, später Event-Sync-
// Client) bekommen Ktor + Serialization + Coroutines transitiv.
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.serialization.json)
api(libs.kotlinx.datetime)
api(libs.ktor.client.core)
api(libs.ktor.client.content.negotiation)
api(libs.ktor.serialization.kotlinx.json)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.ktor.client.mock)
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform.launcher)
}
// Kompiliert mit der gerade laufenden JDK (Android-Studio-JBR = 21),
// erzeugt aber 17er-Bytecode → konsumierbar von AGP/compileSdk 36.
// Bewusst KEIN jvmToolchain(17), damit der Build ohne separate JDK-17-
// Installation läuft.
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
}
tasks.test {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifactId = "mana-kotlin-core"
}
}
repositories {
// Forgejo Packages (Maven) — Default-Empfehlung aus dem Playbook.
// URL + Credentials via Gradle-Properties/Env, damit der normale
// Build ohne Secrets läuft. `./gradlew publish` braucht sie.
maven {
name = "Forgejo"
val forgejoUrl = (findProperty("forgejoPackagesUrl") as String?)
?: "https://git.mana.how/api/packages/mana/maven"
url = uri(forgejoUrl)
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token ${(findProperty("forgejoToken") as String?) ?: System.getenv("FORGEJO_TOKEN") ?: ""}"
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
}