crypto2/build.gradle.kts

143 lines
4.3 KiB
Plaintext
Raw Permalink Normal View History

/*
* Copyright (c) 2025. Sergey S. Chernov - All Rights Reserved
*
* You may use, distribute and modify this code under the
* terms of the private license, which you must obtain from the author
*
* To obtain the license, contact the author: https://t.me/real_sergeych or email to
* real dot sergeych at gmail.
*/
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2025-02-02 21:31:53 +03:00
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2023-11-22 18:49:32 +03:00
plugins {
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"
version = "0.8.1"
2023-11-22 18:49:32 +03:00
repositories {
mavenCentral()
maven("https://maven.universablockchain.com/")
maven("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
2025-02-02 21:31:53 +03:00
maven("https://gitea.sergeych.net/api/packages/YoungBlood/maven")
mavenLocal()
2023-11-22 18:49:32 +03:00
}
kotlin {
jvm {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}
js {
browser()
nodejs()
}
linuxX64()
linuxArm64()
2024-06-08 20:32:37 +07:00
2024-07-28 11:49:59 +02:00
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
mingwX64()
2025-02-02 21:31:53 +03:00
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
}
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 {
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
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"))
implementation("org.kotlincrypto.hash:sha3")
api("com.ionspin.kotlin:bignum:0.3.9")
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")
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 {
dependencies {
}
}
2024-06-08 20:32:37 +07:00
val jvmTest by getting
2025-02-02 21:31:53 +03:00
for (platform in listOf(linuxX64Main, linuxArm64Main, macosX64Main, macosArm64Main, iosX64Main, iosArm64Main, iosSimulatorArm64Main, mingwX64Main))
2024-06-08 20:32:37 +07:00
platform { dependsOn(native) }
2025-02-02 21:31:53 +03:00
val wasmJsMain by getting {
val wasmJsTargetRegex = Regex(pattern = "wasmJs.*")
configurations.all {
if (wasmJsTargetRegex.containsMatchIn(input = this.name)) {
resolutionStrategy.dependencySubstitution {
substitute(module("com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.9.2"))
.using(module("net.sergeych:multiplatform-crypto-libsodium-bindings:0.9.4-SNAPSHOT"))
.withoutClassifier()
}
}
2025-02-02 21:31:53 +03:00
}
}
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")
// }
}
}