11// @file:Suppress("UNUSED_VARIABLE")
22
33plugins {
4- kotlin(" multiplatform" ) version " 1.7.21 "
5- kotlin(" plugin.serialization" ) version " 1.7 .20"
4+ kotlin(" multiplatform" ) version " 1.9.22 "
5+ kotlin(" plugin.serialization" ) version " 1.9 .20"
66 `maven- publish`
77}
88
99group = " net.sergeych"
10- version = " 1.4.3 "
10+ version = " 1.4.5-SNAPSHOT "
1111
12- val serialization_version = " 1.3 .3"
12+ val serialization_version = " 1.6 .3"
1313
1414repositories {
1515 mavenCentral()
@@ -32,37 +32,75 @@ kotlin {
3232 }
3333 }
3434 }
35- ios()
36- val hostOs = System .getProperty(" os.name" )
37- val isMingwX64 = hostOs.startsWith(" Windows" )
38- val nativeTarget = when {
39- hostOs == " Mac OS X" -> macosX64(" native" )
40- hostOs == " Linux" -> linuxX64(" native" )
41- isMingwX64 -> mingwX64(" native" )
42- else -> throw GradleException (" Host OS is not supported in Kotlin/Native." )
35+
36+ wasmJs {
37+ browser()
38+ binaries.executable()
39+ }
40+
41+ // val hostOs = System.getProperty("os.name")
42+ // val isMingwX64 = hostOs.startsWith("Windows")
43+ // val nativeTarget = when {
44+ // hostOs == "Mac OS X" -> macosX64("native")
45+ // hostOs == "Linux" -> linuxX64("native")
46+ // isMingwX64 -> mingwX64("native")
47+ // else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
48+ // }
49+ //
50+ // val publicationsFromMainHost =
51+ // listOf(jvm(), js()).map { it.name } + "kotlinMultiplatform"
52+ linuxX64(" native" ) {
53+ binaries.staticLib {
54+ baseName = " mp_bintools"
55+ }
4356 }
4457
45- val publicationsFromMainHost =
46- listOf (jvm(), js()).map { it.name } + " kotlinMultiplatform"
58+ listOf (
59+ iosX64(),
60+ iosArm64(),
61+ iosSimulatorArm64()
62+ ).forEach {
63+ it.binaries.framework {
64+ baseName = " mp_bintools"
65+ isStatic = true
66+ }
67+ }
68+
69+ listOf (
70+ macosX64(),
71+ macosArm64()
72+ ).forEach {
73+ it.binaries.framework {
74+ baseName = " mp_bintools"
75+ isStatic = true
76+ }
77+ }
78+
79+
80+ mingwX64() {
81+ binaries.staticLib {
82+ baseName = " mp_bintools"
83+ }
84+ }
4785
4886 sourceSets {
4987 all {
5088// languageSettings.optIn("kotlin.RequiresOptIn")
5189// languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
5290// languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
53- languageSettings.optIn(" kotlin.ExperimentalUnsignedTypes" )
91+ languageSettings.optIn(" kotlin.ExperimentalUnsignedTypes" )
5492 }
5593 val commonMain by getting {
5694 dependencies {
5795 api(" org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version " )
58- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3 " )
59- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4 .0" )
96+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0 " )
97+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.5 .0" )
6098 }
6199 }
62100 val commonTest by getting {
63101 dependencies {
64102 implementation(kotlin(" test" ))
65- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1 " )
103+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0 " )
66104 }
67105 }
68106 val jvmMain by getting
@@ -71,17 +109,19 @@ kotlin {
71109 val jsTest by getting
72110 val nativeMain by getting
73111 val nativeTest by getting
112+ val wasmJsMain by getting
113+ val wasmJsTest by getting
74114 }
75115
76116 publishing {
77117 publications {
78118
79- matching { it.name in publicationsFromMainHost }.all {
80- val targetPublication = this @all
81- tasks.withType<AbstractPublishToMaven >()
82- .matching { it.publication == targetPublication }
83- .configureEach { onlyIf { findProperty(" isMainHost" ) == " true" } }
84- }
119+ // matching { it.name in publicationsFromMainHost }.all {
120+ // val targetPublication = this@all
121+ // tasks.withType<AbstractPublishToMaven>()
122+ // .matching { it.publication == targetPublication }
123+ // .configureEach { onlyIf { findProperty("isMainHost") == "true" } }
124+ // }
85125
86126// create<MavenPublication>("maven") {
87127// from(components["java"])
0 commit comments