2024-09-01 19:42:23 +02:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
|
2023-11-11 23:52:18 +03:00
|
|
|
plugins {
|
2024-12-26 03:25:11 +03:00
|
|
|
kotlin("multiplatform") version "2.0.21"
|
|
|
|
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.21"
|
2023-11-11 23:52:18 +03:00
|
|
|
`maven-publish`
|
2024-08-05 17:51:33 +02:00
|
|
|
id("org.jetbrains.dokka") version "1.9.20"
|
2023-11-11 23:52:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
group = "net.sergeych"
|
2024-12-10 10:36:57 +03:00
|
|
|
version = "0.5.2-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-09-01 19:42:23 +02:00
|
|
|
jvm {
|
|
|
|
compilerOptions {
|
|
|
|
jvmTarget = JvmTarget.JVM_11
|
|
|
|
}
|
|
|
|
}
|
2024-08-01 02:36:37 +02:00
|
|
|
js {
|
2023-11-11 23:52:18 +03:00
|
|
|
browser {
|
|
|
|
}
|
2024-08-04 02:05:35 +02:00
|
|
|
nodejs()
|
2023-11-11 23:52:18 +03:00
|
|
|
}
|
2024-11-26 18:57:59 +07:00
|
|
|
// macosArm64()
|
|
|
|
// iosX64()
|
|
|
|
// iosArm64()
|
|
|
|
// iosSimulatorArm64()
|
2024-03-16 20:33:22 +01:00
|
|
|
linuxX64()
|
2024-06-25 10:39:00 +07:00
|
|
|
linuxArm64()
|
2024-11-26 18:57:59 +07:00
|
|
|
// macosX64()
|
|
|
|
// macosX64()
|
|
|
|
mingwX64()
|
2023-11-11 23:52:18 +03:00
|
|
|
|
2024-08-01 02:36:37 +02:00
|
|
|
val ktor_version = "2.3.12"
|
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 {
|
2024-08-30 11:05:19 +02:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2")
|
2024-02-20 02:09:25 +03:00
|
|
|
api("io.ktor:ktor-client-core:$ktor_version")
|
2024-12-10 10:36:57 +03:00
|
|
|
api("net.sergeych:crypto2:0.7.1-SNAPSHOT")
|
2023-11-11 23:52:18 +03:00
|
|
|
}
|
|
|
|
}
|
2024-08-02 02:47:26 +02:00
|
|
|
val ktorSocketMain by creating {
|
|
|
|
dependsOn(commonMain)
|
|
|
|
dependencies {
|
|
|
|
implementation("io.ktor:ktor-network:$ktor_version")
|
|
|
|
}
|
|
|
|
}
|
2023-11-11 23:52:18 +03:00
|
|
|
val commonTest by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("test"))
|
|
|
|
implementation("org.slf4j:slf4j-simple:2.0.9")
|
2024-08-01 02:36:37 +02:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1")
|
2023-11-11 23:52:18 +03:00
|
|
|
}
|
|
|
|
}
|
2024-08-03 15:36:04 +02:00
|
|
|
val ktorSocketTest by creating {
|
|
|
|
dependsOn(commonTest)
|
|
|
|
}
|
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
|
|
|
}
|
2024-08-02 02:47:26 +02:00
|
|
|
dependsOn(ktorSocketMain)
|
2023-11-20 15:49:29 +03:00
|
|
|
}
|
2024-08-03 15:36:04 +02:00
|
|
|
val jvmTest by getting {
|
|
|
|
dependsOn(ktorSocketTest)
|
|
|
|
}
|
|
|
|
|
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-11-26 18:57:59 +07:00
|
|
|
// val macosArm64Main by getting {
|
|
|
|
// dependsOn(ktorSocketMain)
|
|
|
|
// }
|
|
|
|
// val macosArm64Test by getting {
|
|
|
|
// dependsOn(ktorSocketTest)
|
|
|
|
// }
|
|
|
|
// val macosX64Main by getting {
|
|
|
|
// dependsOn(ktorSocketMain)
|
|
|
|
// }
|
|
|
|
// val iosX64Main by getting {
|
|
|
|
// dependsOn(ktorSocketMain)
|
|
|
|
// }
|
|
|
|
// val iosX64Test by getting {
|
|
|
|
// dependsOn(ktorSocketTest)
|
|
|
|
// }
|
|
|
|
// val iosArm64Main by getting {
|
|
|
|
// dependsOn(ktorSocketMain)
|
|
|
|
// }
|
|
|
|
// val iosArm64Test by getting {
|
|
|
|
// dependsOn(ktorSocketTest)
|
|
|
|
// }
|
2024-08-03 15:36:04 +02:00
|
|
|
val linuxArm64Main by getting {
|
|
|
|
dependsOn(ktorSocketMain)
|
|
|
|
}
|
|
|
|
val linuxArm64Test by getting {
|
|
|
|
dependsOn(ktorSocketTest)
|
|
|
|
}
|
|
|
|
val linuxX64Main by getting {
|
|
|
|
dependsOn(ktorSocketMain)
|
|
|
|
}
|
|
|
|
val linuxX64Test by getting {
|
|
|
|
dependsOn(ktorSocketTest)
|
|
|
|
}
|
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
|
|
|
}
|
2024-08-05 17:51:33 +02:00
|
|
|
|
|
|
|
tasks.dokkaHtml.configure {
|
|
|
|
outputDirectory.set(buildDir.resolve("dokka"))
|
|
|
|
dokkaSourceSets {
|
|
|
|
configureEach {
|
|
|
|
// includes.from("docs/bipack.md")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|