127 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			127 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/*
 | 
						|
 * 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
 | 
						|
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
 | 
						|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
 | 
						|
 | 
						|
plugins {
 | 
						|
    kotlin("multiplatform") version "2.2.20"
 | 
						|
    id("org.jetbrains.kotlin.plugin.serialization") version "2.2.20"
 | 
						|
    id("org.jetbrains.dokka") version "1.9.20"
 | 
						|
    `maven-publish`
 | 
						|
}
 | 
						|
 | 
						|
group = "net.sergeych"
 | 
						|
version = "0.8.5"
 | 
						|
 | 
						|
repositories {
 | 
						|
    mavenCentral()
 | 
						|
    maven("https://maven.universablockchain.com/")
 | 
						|
    maven("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
 | 
						|
    maven("https://gitea.sergeych.net/api/packages/YoungBlood/maven")
 | 
						|
    mavenLocal()
 | 
						|
}
 | 
						|
 | 
						|
kotlin {
 | 
						|
    jvm {
 | 
						|
        @OptIn(ExperimentalKotlinGradlePluginApi::class)
 | 
						|
        compilerOptions {
 | 
						|
            jvmTarget = JvmTarget.JVM_11
 | 
						|
        }
 | 
						|
    }
 | 
						|
    js {
 | 
						|
        browser()
 | 
						|
        nodejs()
 | 
						|
    }
 | 
						|
    linuxX64()
 | 
						|
    linuxArm64()
 | 
						|
 | 
						|
    macosX64()
 | 
						|
    macosArm64()
 | 
						|
    iosX64()
 | 
						|
    iosArm64()
 | 
						|
    iosSimulatorArm64()
 | 
						|
    mingwX64()
 | 
						|
    @OptIn(ExperimentalWasmDsl::class)
 | 
						|
    wasmJs {
 | 
						|
        browser()
 | 
						|
    }
 | 
						|
 | 
						|
    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.8.1")
 | 
						|
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0")
 | 
						|
 | 
						|
                implementation("net.sergeych:multiplatform-crypto-libsodium-bindings:0.9.6")
 | 
						|
                implementation(project.dependencies.platform("org.kotlincrypto.hash:bom:0.5.1"))
 | 
						|
                implementation("org.kotlincrypto.hash:sha3")
 | 
						|
                api("com.ionspin.kotlin:bignum:0.3.10")
 | 
						|
                api("net.sergeych:mp_bintools:0.2.2")
 | 
						|
            }
 | 
						|
        }
 | 
						|
        val commonTest by getting {
 | 
						|
            dependencies {
 | 
						|
                implementation(kotlin("test"))
 | 
						|
                implementation("org.slf4j:slf4j-simple:2.0.9")
 | 
						|
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.1")
 | 
						|
            }
 | 
						|
        }
 | 
						|
        val native by creating {
 | 
						|
            dependsOn(commonMain)
 | 
						|
            dependencies {
 | 
						|
            }
 | 
						|
        }
 | 
						|
        val jvmMain by getting {
 | 
						|
            dependencies {
 | 
						|
            }
 | 
						|
        }
 | 
						|
        val jvmTest by getting
 | 
						|
        for (platform in listOf(linuxX64Main, linuxArm64Main, macosX64Main, macosArm64Main, iosX64Main, iosArm64Main, iosSimulatorArm64Main, mingwX64Main))
 | 
						|
            platform { dependsOn(native) }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
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)
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
tasks.dokkaHtml.configure {
 | 
						|
    outputDirectory.set(buildDir.resolve("dokka"))
 | 
						|
    dokkaSourceSets {
 | 
						|
//        configureEach {
 | 
						|
//            includes.from("docs/bipack.md")
 | 
						|
//        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
 |