https://kotlinlang.org logo
k

Kareem Radwan

11/08/2021, 3:00 PM
hi there I finish from my own kmp library, after that I used
publishToMavenLocal
task to use it on other project when I add my library on new kotlin multipatform project only
jvm
target was added no
js
or
ios
I think I want add this code
Copy code
kotlin {
    jvm()
    js()
    mingwX64()
    linuxX64()
    val publicationsFromMainHost =
        listOf(jvm(), js()).map { it.name } + "kotlinMultiplatform"
    publishing {
        publications {
            matching { it.name in publicationsFromMainHost }.all {
                val targetPublication = this@all
                tasks.withType<AbstractPublishToMaven>()
                        .matching { it.publication == targetPublication }
                        .configureEach { onlyIf { findProperty("isMainHost") == "true" } }
            }
        }
    }
}
6 Views