2024-11-25 17:11:08 +07:00
|
|
|
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
2024-08-30 11:08:41 +02:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
|
2023-11-22 18:49:32 +03:00
|
|
|
plugins {
|
2024-08-24 08:34:50 +02:00
|
|
|
kotlin("multiplatform") version "2.0.20"
|
|
|
|
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.20"
|
2024-08-25 02:28:11 +02:00
|
|
|
id("org.jetbrains.dokka") version "1.9.20"
|
2023-11-22 18:49:32 +03:00
|
|
|
`maven-publish`
|
|
|
|
}
|
|
|
|
|
|
|
|
group = "net.sergeych"
|
2024-11-26 18:50:07 +07:00
|
|
|
version = "0.7.1-SNAPSHOT"
|
2023-11-22 18:49:32 +03:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven("https://maven.universablockchain.com/")
|
|
|
|
maven("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
|
2024-06-08 16:18:07 +07:00
|
|
|
mavenLocal()
|
2023-11-22 18:49:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
2024-08-30 11:08:41 +02:00
|
|
|
jvm {
|
2024-11-25 17:11:08 +07:00
|
|
|
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
2024-08-30 11:08:41 +02:00
|
|
|
compilerOptions {
|
|
|
|
jvmTarget = JvmTarget.JVM_11
|
|
|
|
}
|
|
|
|
}
|
2024-06-11 12:33:37 +07:00
|
|
|
js {
|
|
|
|
browser()
|
2024-08-24 08:34:50 +02:00
|
|
|
nodejs()
|
2024-06-11 12:33:37 +07:00
|
|
|
}
|
2024-03-16 10:47:32 +01:00
|
|
|
linuxX64()
|
2024-06-25 10:40:59 +07:00
|
|
|
linuxArm64()
|
2024-06-08 20:32:37 +07:00
|
|
|
|
2024-07-28 11:49:59 +02:00
|
|
|
macosX64()
|
|
|
|
macosArm64()
|
|
|
|
iosX64()
|
|
|
|
iosArm64()
|
|
|
|
iosSimulatorArm64()
|
2024-03-16 10:47:32 +01:00
|
|
|
mingwX64()
|
2024-06-11 12:33:37 +07:00
|
|
|
// @OptIn(ExperimentalWasmDsl::class)
|
|
|
|
// wasmJs() //no libsodium bindings yet (strangely)
|
2024-03-16 10:47:32 +01:00
|
|
|
// val ktor_version = "2.3.6"
|
2023-11-22 18:49:32 +03:00
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
all {
|
|
|
|
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
|
|
|
languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
|
|
|
|
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
|
|
|
|
}
|
|
|
|
|
2024-06-08 20:32:37 +07:00
|
|
|
|
2023-11-22 18:49:32 +03:00
|
|
|
val commonMain by getting {
|
|
|
|
dependencies {
|
2024-06-08 16:18:07 +07:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0")
|
2023-11-22 18:49:32 +03:00
|
|
|
|
2024-06-11 12:33:37 +07:00
|
|
|
implementation("com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.9.2")
|
2024-08-25 02:50:42 +02:00
|
|
|
implementation(project.dependencies.platform("org.kotlincrypto.hash:bom:0.5.1"))
|
2024-08-25 02:07:10 +02:00
|
|
|
implementation("org.kotlincrypto.hash:sha3")
|
2024-03-16 10:47:32 +01:00
|
|
|
api("com.ionspin.kotlin:bignum:0.3.9")
|
2024-08-24 08:34:50 +02:00
|
|
|
api("net.sergeych:mp_bintools:0.1.7")
|
2024-07-28 11:49:59 +02:00
|
|
|
api("net.sergeych:mp_stools:1.5.1")
|
2023-11-22 18:49:32 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
val commonTest by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("test"))
|
|
|
|
implementation("org.slf4j:slf4j-simple:2.0.9")
|
2024-06-22 10:24:32 +07:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1")
|
2023-11-22 18:49:32 +03:00
|
|
|
}
|
|
|
|
}
|
2024-06-08 20:32:37 +07:00
|
|
|
val native by creating {
|
|
|
|
dependsOn(commonMain)
|
2023-11-22 18:49:32 +03:00
|
|
|
dependencies {
|
|
|
|
}
|
|
|
|
}
|
2024-06-08 20:32:37 +07:00
|
|
|
val jvmMain by getting {
|
2024-06-08 16:22:15 +07:00
|
|
|
dependencies {
|
|
|
|
}
|
|
|
|
}
|
2024-06-08 20:32:37 +07:00
|
|
|
val jvmTest by getting
|
|
|
|
for (platform in listOf(linuxMain, macosMain, iosMain, mingwMain))
|
|
|
|
platform { dependsOn(native) }
|
2023-11-22 18:49:32 +03:00
|
|
|
}
|
|
|
|
}
|
2023-11-22 23:55:14 +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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-08-25 02:28:11 +02:00
|
|
|
|
|
|
|
tasks.dokkaHtml.configure {
|
|
|
|
outputDirectory.set(buildDir.resolve("dokka"))
|
|
|
|
dokkaSourceSets {
|
|
|
|
// configureEach {
|
|
|
|
// includes.from("docs/bipack.md")
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|