Kareem Radwan

    Kareem Radwan

    10 months ago
    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
    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" } }
                }
            }
        }
    }