2023-11-11 23:52:18 +03:00
|
|
|
|
|
|
|
plugins {
|
2024-06-13 11:54:20 +07:00
|
|
|
kotlin("multiplatform") version "2.0.0"
|
|
|
|
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0"
|
2023-11-11 23:52:18 +03:00
|
|
|
`maven-publish`
|
|
|
|
}
|
|
|
|
|
|
|
|
group = "net.sergeych"
|
2024-06-13 11:54:20 +07:00
|
|
|
version = "0.2.1-SNAPSHOT"
|
2023-11-11 23:52:18 +03:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
maven("https://maven.universablockchain.com/")
|
2023-11-23 01:01:44 +03:00
|
|
|
maven("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
|
2023-11-11 23:52:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
2024-06-13 11:54:20 +07:00
|
|
|
jvm()
|
2024-02-20 02:09:25 +03:00
|
|
|
js(IR) {
|
2023-11-11 23:52:18 +03:00
|
|
|
browser {
|
|
|
|
// commonWebpackConfig {
|
|
|
|
// cssSupport {
|
|
|
|
// enabled.set(true)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
2024-03-16 20:33:22 +01:00
|
|
|
// val hostOs = System.getProperty("os.name")
|
|
|
|
// val isArm64 = System.getProperty("os.arch") == "aarch64"
|
|
|
|
// val isMingwX64 = hostOs.startsWith("Windows")
|
|
|
|
// @Suppress("UNUSED_VARIABLE")
|
|
|
|
// val nativeTarget = when {
|
|
|
|
// hostOs == "Mac OS X" && isArm64 -> macosArm64("native")
|
|
|
|
// hostOs == "Mac OS X" && !isArm64 -> macosX64("native")
|
|
|
|
// hostOs == "Linux" && isArm64 -> linuxArm64("native")
|
|
|
|
// hostOs == "Linux" && !isArm64 -> linuxX64("native")
|
|
|
|
// isMingwX64 -> mingwX64("native")
|
|
|
|
// else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
|
|
|
|
// }
|
|
|
|
|
2024-04-23 21:49:15 +03:00
|
|
|
// macosArm64()
|
|
|
|
// iosX64()
|
|
|
|
// iosArm64()
|
|
|
|
// iosSimulatorArm64()
|
2024-03-16 20:33:22 +01:00
|
|
|
linuxX64()
|
2024-04-23 21:49:15 +03:00
|
|
|
// macosX64()
|
2024-03-16 20:33:22 +01:00
|
|
|
|
2023-11-11 23:52:18 +03:00
|
|
|
|
2023-11-20 15:49:29 +03:00
|
|
|
val ktor_version = "2.3.6"
|
2023-11-11 23:52:18 +03:00
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
all {
|
|
|
|
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
|
|
|
languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
|
|
|
|
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
|
|
|
|
}
|
|
|
|
|
|
|
|
val commonMain by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
|
|
|
|
|
2024-06-13 11:54:20 +07:00
|
|
|
// api("com.ionspin.kotlin:bignum:0.3.9")
|
2024-02-20 02:09:25 +03:00
|
|
|
api("io.ktor:ktor-client-core:$ktor_version")
|
2023-11-11 23:52:18 +03:00
|
|
|
|
2024-06-13 11:54:20 +07:00
|
|
|
// api("net.sergeych:mp_bintools:0.1.1")
|
|
|
|
// api("net.sergeych:mp_stools:1.4.7")
|
|
|
|
api("net.sergeych:crypto2:0.2.2-SNAPSHOT")
|
2023-11-11 23:52:18 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
val commonTest by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("test"))
|
|
|
|
implementation("org.slf4j:slf4j-simple:2.0.9")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
|
|
|
}
|
|
|
|
}
|
2023-11-20 15:49:29 +03:00
|
|
|
val jvmMain by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation("io.ktor:ktor-server-core:$ktor_version")
|
|
|
|
implementation("io.ktor:ktor-server-core-jvm:$ktor_version")
|
|
|
|
implementation("io.ktor:ktor-server-websockets-jvm:$ktor_version")
|
|
|
|
implementation("io.ktor:ktor-server-netty:$ktor_version")
|
2024-02-20 02:09:25 +03:00
|
|
|
api("io.ktor:ktor-client-cio:$ktor_version")
|
2023-11-20 15:49:29 +03:00
|
|
|
}
|
|
|
|
}
|
2023-11-11 23:52:18 +03:00
|
|
|
val jvmTest by getting
|
2023-11-20 15:49:29 +03:00
|
|
|
val jsMain by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation("io.ktor:ktor-client-js:$ktor_version")
|
|
|
|
}
|
|
|
|
}
|
2023-11-11 23:52:18 +03:00
|
|
|
val jsTest by getting
|
2024-03-16 20:33:22 +01:00
|
|
|
// val nativeMain by getting {
|
|
|
|
// dependencies {
|
|
|
|
// implementation("io.ktor:ktor-client-cio:$ktor_version")
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// val nativeTest by getting
|
2023-11-11 23:52:18 +03:00
|
|
|
}
|
2024-02-20 02:09:25 +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-11-11 23:52:18 +03:00
|
|
|
}
|