2023-02-03 15:10:43 +03:00
|
|
|
plugins {
|
2024-01-28 16:06:48 +03:00
|
|
|
kotlin("multiplatform") version "1.9.22"
|
|
|
|
kotlin("plugin.serialization") version "1.9.22"
|
|
|
|
id("org.jetbrains.dokka") version "1.9.10"
|
2023-03-13 00:48:21 +03:00
|
|
|
`maven-publish`
|
2023-02-03 15:10:43 +03:00
|
|
|
}
|
|
|
|
|
2023-03-16 01:03:45 +03:00
|
|
|
val serialization_version = "1.3.4"
|
|
|
|
|
2023-02-03 15:10:43 +03:00
|
|
|
group = "net.sergeych"
|
2024-04-27 01:09:58 +03:00
|
|
|
version = "0.1.3"
|
2023-02-03 15:10:43 +03:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
maven("https://maven.universablockchain.com/")
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
2024-04-23 21:49:57 +03:00
|
|
|
jvmToolchain(17)
|
2023-02-03 15:10:43 +03:00
|
|
|
jvm {
|
2024-04-27 01:09:58 +03:00
|
|
|
// compilations.all {
|
|
|
|
// kotlinOptions.jvmTarget = "1.8"
|
|
|
|
// }
|
2023-02-03 15:10:43 +03:00
|
|
|
withJava()
|
|
|
|
testRuns["test"].executionTask.configure {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
js(IR) {
|
|
|
|
browser {
|
2023-03-31 08:20:26 +03:00
|
|
|
testTask {
|
|
|
|
useKarma {
|
|
|
|
// /home/sergeych/snap/firefox/common/.mozilla/firefox/iff469o9.default
|
|
|
|
// /home/sergeych/snap/firefox/common/.mozilla/firefox/iff469o9.default
|
|
|
|
// useFirefox()
|
|
|
|
useChromeHeadless()
|
|
|
|
// useSafari()
|
|
|
|
}
|
|
|
|
}
|
2023-03-11 17:36:09 +03:00
|
|
|
// commonWebpackConfig {
|
|
|
|
// cssSupport.enabled = true
|
|
|
|
// }
|
2023-02-03 15:10:43 +03:00
|
|
|
}
|
2023-03-31 08:20:26 +03:00
|
|
|
nodejs {
|
|
|
|
testTask {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2023-02-03 15:10:43 +03:00
|
|
|
}
|
2023-03-31 08:20:26 +03:00
|
|
|
|
2024-04-27 01:09:58 +03:00
|
|
|
macosArm64()
|
|
|
|
iosX64()
|
|
|
|
iosArm64()
|
|
|
|
macosX64()
|
|
|
|
iosSimulatorArm64()
|
|
|
|
|
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.")
|
|
|
|
// }
|
|
|
|
|
|
|
|
linuxX64("native") {
|
|
|
|
binaries.staticLib {
|
|
|
|
baseName = "mp_bintools"
|
|
|
|
}
|
2023-02-03 15:10:43 +03:00
|
|
|
}
|
|
|
|
|
2024-02-26 12:44:44 +03:00
|
|
|
wasmJs {
|
|
|
|
browser()
|
|
|
|
binaries.executable()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mingwX64() {
|
|
|
|
binaries.staticLib {
|
|
|
|
baseName = "mp_bintools"
|
|
|
|
}
|
|
|
|
}
|
2024-04-27 01:09:58 +03:00
|
|
|
|
2023-02-03 15:10:43 +03:00
|
|
|
sourceSets {
|
2023-03-13 00:48:21 +03:00
|
|
|
all {
|
|
|
|
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
2023-10-26 10:35:16 +03:00
|
|
|
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
|
2024-02-18 22:50:37 +03:00
|
|
|
languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
|
2023-03-13 00:48:21 +03:00
|
|
|
}
|
2023-02-03 15:10:43 +03:00
|
|
|
val commonMain by getting {
|
|
|
|
dependencies {
|
2024-02-26 12:44:44 +03:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
|
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")
|
2024-04-27 01:09:58 +03:00
|
|
|
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")
|
2023-02-03 15:10:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
val commonTest by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("test"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val jvmMain by getting
|
|
|
|
val jvmTest by getting
|
2024-02-18 22:50:37 +03:00
|
|
|
val jsMain by getting {
|
|
|
|
dependencies {
|
|
|
|
}
|
|
|
|
}
|
2023-02-03 15:10:43 +03:00
|
|
|
val jsTest by getting
|
|
|
|
val nativeMain by getting
|
|
|
|
val nativeTest by getting
|
2024-02-26 12:44:44 +03:00
|
|
|
val wasmJsMain by getting {
|
|
|
|
dependencies {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val wasmJsTest by getting
|
2023-02-03 15:10:43 +03:00
|
|
|
}
|
2023-03-13 00:48:21 +03:00
|
|
|
|
|
|
|
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-02-03 15:10:43 +03:00
|
|
|
}
|
2023-03-16 01:03:45 +03:00
|
|
|
|
|
|
|
tasks.dokkaHtml.configure {
|
|
|
|
outputDirectory.set(buildDir.resolve("dokka"))
|
|
|
|
dokkaSourceSets {
|
|
|
|
configureEach {
|
|
|
|
includes.from("docs/bipack.md")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|