mp_bintools/build.gradle.kts

140 lines
3.6 KiB
Plaintext
Raw Normal View History

plugins {
2024-06-08 16:27:51 +03:00
kotlin("multiplatform") version "2.0.0"
kotlin("plugin.serialization") version "2.0.0"
2024-06-30 08:50:52 +03:00
id("org.jetbrains.dokka") version "1.9.20"
`maven-publish`
}
2024-06-29 06:32:03 +03:00
val serialization_version = "1.6.5-SNAPSHOT"
2023-03-16 01:03:45 +03:00
group = "net.sergeych"
2024-06-30 08:50:52 +03:00
version = "0.1.6-SNAPSHOT"
repositories {
mavenCentral()
mavenLocal()
maven("https://maven.universablockchain.com/")
}
kotlin {
2024-06-08 16:27:51 +03:00
jvmToolchain(8)
jvm {
// compilations.all {
// kotlinOptions.jvmTarget = "1.8"
// }
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
2024-06-29 06:32:03 +03:00
js {
browser()
nodejs()
}
2024-06-08 16:27:51 +03:00
// macosArm64()
// iosX64()
// iosArm64()
// macosX64()
// iosSimulatorArm64()
linuxX64()
linuxArm64()
mingwX64()
2024-02-26 12:44:44 +03:00
// val hostOs = System.getProperty("os.name")
// val isMingwX64 = hostOs.startsWith("Windows")
// val nativeTarget = when {
// hostOs == "Mac OS X" -> macosX64("native")
// hostOs == "Linux" -> linuxX64("native")
// isMingwX64 -> mingwX64("native")
// else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
// }
wasmJs {
browser()
2024-06-30 08:50:52 +03:00
// binaries.executable()
2024-02-26 12:44:44 +03:00
}
mingwX64() {
binaries.staticLib {
baseName = "mp_bintools"
}
}
sourceSets {
all {
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
2023-10-26 10:35:16 +03:00
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
}
val commonMain by getting {
dependencies {
2024-06-08 16:27:51 +03:00
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
2023-03-16 01:03:45 +03:00
// this is actually a bug: we need only the core, but bare core causes strange errors
2024-02-26 12:44:44 +03:00
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
api("net.sergeych:mp_stools:[1.4.7,)")
2024-02-26 12:44:44 +03:00
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
}
}
2024-06-08 16:27:51 +03:00
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
2024-06-08 16:27:51 +03:00
// val nativeTest by getting
2024-02-26 12:44:44 +03:00
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)
}
}
}
}
}
2023-03-16 01:03:45 +03:00
tasks.dokkaHtml.configure {
outputDirectory.set(buildDir.resolve("dokka"))
dokkaSourceSets {
configureEach {
includes.from("docs/bipack.md")
}
}
}