150 lines
3.5 KiB
Kotlin
150 lines
3.5 KiB
Kotlin
//@file:OptIn(ExperimentalKotlinGradlePluginApi::class)
|
|
@file:OptIn(ExperimentalWasmDsl::class)
|
|
|
|
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
plugins {
|
|
kotlin("multiplatform") version masterLibs.versions.kotlinVersion
|
|
// `java-library`
|
|
`maven-publish`
|
|
alias(masterLibs.plugins.dokkaPlugin)
|
|
alias(masterLibs.plugins.versionPlugin)
|
|
}
|
|
|
|
group = "net.keinekekse"
|
|
version = masterLibs.versions.utilLibraryVersion.get()
|
|
description = "Kotlin Utility Library"
|
|
extra["displayname"] = "Utility Library"
|
|
extra["copyright"] = "Copyright (c) 2025-2026 Hartmut Bauer"
|
|
|
|
repositories {
|
|
maven("https://nexus.keinekekse.net/repository/maven-public/")
|
|
}
|
|
|
|
//dependencies {
|
|
// implementation(masterLibs.kotlinxSerialization)
|
|
// // f. cmd line via annotation KMP?
|
|
// implementation(kotlin("reflect"))
|
|
//
|
|
//}
|
|
|
|
kotlin {
|
|
// explicitApi()
|
|
|
|
jvm {
|
|
compilerOptions.jvmTarget =
|
|
JvmTarget.valueOf("JVM_" + masterLibs.versions.javaVersion.get()) //JvmTarget.JVM_1_8
|
|
}
|
|
|
|
js {
|
|
browser {
|
|
testTask {
|
|
useKarma {
|
|
useChromeHeadless()
|
|
}
|
|
}
|
|
}
|
|
nodejs()
|
|
}
|
|
|
|
wasmJs {
|
|
browser {
|
|
testTask {
|
|
useKarma {
|
|
useChromeHeadless()
|
|
}
|
|
}
|
|
}
|
|
nodejs()
|
|
}
|
|
|
|
wasmWasi {
|
|
nodejs()
|
|
}
|
|
|
|
// macosX64()
|
|
macosArm64()
|
|
|
|
// iosX64()
|
|
// iosArm64()
|
|
// iosSimulatorArm64()
|
|
|
|
// watchosArm32()
|
|
// watchosArm64()
|
|
// watchosX64()
|
|
// watchosSimulatorArm64()
|
|
// watchosDeviceArm64()
|
|
|
|
// tvosArm64()
|
|
// tvosX64()
|
|
// tvosSimulatorArm64()
|
|
|
|
// mingwX64()
|
|
|
|
linuxX64()
|
|
// linuxArm64()
|
|
|
|
// androidNativeArm32()
|
|
// androidNativeArm64()
|
|
// androidNativeX86()
|
|
// androidNativeX64()
|
|
|
|
applyDefaultHierarchyTemplate()
|
|
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
implementation(masterLibs.kotlinxSerialization)
|
|
}
|
|
jvmMain.dependencies {
|
|
implementation(kotlin("reflect"))
|
|
}
|
|
|
|
// commonTest.dependencies {
|
|
// implementation(libs.kotlin.test)
|
|
// implementation(libs.serialization.json)
|
|
// }
|
|
}
|
|
}
|
|
|
|
//kotlin {
|
|
// jvmToolchain(masterLibs.versions.javaVersion.get().toInt())
|
|
//// compilerOptions {
|
|
//// languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_3)
|
|
//// }
|
|
//}
|
|
|
|
/* Generierte Dokka-Doku als javadoc.jar ausgeben (s.a. "publishing")
|
|
tasks.register<Jar>("dokkaJar") {
|
|
group = "build"
|
|
description = "Assembles a JAR containing the Dokka documentation."
|
|
dependsOn(tasks.dokkaGeneratePublicationHtml) // Ensure Dokka is generated before creating the JAR
|
|
// dependsOn(tasks.dokkaGeneratePublicationJavadoc) // Ensure Dokka is generated before creating the JAR
|
|
archiveClassifier.set("javadoc")
|
|
from(layout.buildDirectory.dir("dokka")) // Use the output directory of Dokka
|
|
}
|
|
*/
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
credentials {
|
|
username = "admin"
|
|
password = "admin123"
|
|
}
|
|
url = uri("https://nexus.keinekekse.net/repository/maven-releases/")
|
|
}
|
|
}
|
|
// publications.create<MavenPublication>("maven") {
|
|
// from(components["java"])
|
|
//// artifact(tasks["dokkaJar"])
|
|
// }
|
|
}
|
|
|
|
// ./gradlew dokkaGenerate
|
|
dokka {
|
|
dokkaPublications.html {
|
|
outputDirectory.set(project.file("docs/api"))
|
|
}
|
|
}
|