mp_bintools/build.gradle.kts
2024-08-24 07:13:38 +02:00

124 lines
3.0 KiB
Plaintext

plugins {
kotlin("multiplatform") version "2.0.20"
kotlin("plugin.serialization") version "2.0.20"
id("org.jetbrains.dokka") version "1.9.20"
`maven-publish`
}
val serialization_version = "1.6.5-SNAPSHOT"
group = "net.sergeych"
version = "0.1.7"
repositories {
mavenCentral()
mavenLocal()
maven("https://maven.universablockchain.com/")
}
kotlin {
jvmToolchain(8)
jvm()
js {
browser()
nodejs()
}
macosArm64()
iosX64()
iosArm64()
macosX64()
iosSimulatorArm64()
linuxX64()
linuxArm64()
mingwX64()
wasmJs {
browser()
binaries.executable()
}
mingwX64() {
binaries.staticLib {
baseName = "mp_bintools"
}
}
sourceSets {
all {
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
}
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
// this is actually a bug: we need only the core, but bare core causes strange errors
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
api("net.sergeych:mp_stools:[1.4.7,)")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
}
}
val nativeMain by creating {
dependsOn(commonMain)
dependencies {
}
}
val linuxX64Main by getting {
dependsOn(nativeMain)
}
val linuxArm64Main by getting {
dependsOn(nativeMain)
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting
val jvmTest by getting
val jsMain by getting {
dependencies {
}
}
val jsTest by getting
// val nativeTest by getting
val wasmJsMain by getting {
dependencies {
}
}
val wasmJsTest by getting
}
publishing {
val mavenToken by lazy {
File("${System.getProperty("user.home")}/.gitea_token").readText()
}
repositories {
maven {
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = mavenToken
}
url = uri("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
authentication {
create("Authorization", HttpHeaderAuthentication::class)
}
}
}
}
}
tasks.dokkaHtml.configure {
outputDirectory.set(buildDir.resolve("dokka"))
dokkaSourceSets {
configureEach {
includes.from("docs/bipack.md")
}
}
}