Im trying to upgrade my gradle to .kts, but I seem...
# multiplatform
g
Im trying to upgrade my gradle to .kts, but I seem to have some issue with the publishing of my multiplatform library: old:
Copy code
afterEvaluate {
    publishing {
        publications {
                kotlinMultiplatform { publication ->
                    artifactId = project.name
                    groupId = gradle.ext.group_id
                    version = gradle.ext.library_version
                }
            }
        }
    }
}
new:
Copy code
afterEvaluate {
    publishing {
        publications {
                    getByName("kotlinMultiplatform") {
                        (this as MavenPublication).let {
                            artifactId = name
                            groupId = Library.group
                            version = Library.version
                        }
                    }
        }
    }
}
All the jars etc seem to be generated just fine, but on the new implementation I dont get a root folder for the artifact, even though kotlin documentation specifies:
Copy code
Some repositories, such as Maven Central, require that the root module contains a JAR artifact without a classifier, for example kotlinMultiplatform-1.0.jar.
The Kotlin Multiplatform plugin automatically produces the required artifact with the embedded metadata artifacts.
This means you don't have to customize your build by adding an empty artifact to the root module of your library to meet the repository's requirements.
https://kotlinlang.org/docs/multiplatform-publish-lib.html#structure-of-publications What could I be doing wrong?
đź‘€ 1
n
I don’t know, but looks like artifactId will be different in old vs. new.
g
Ah, that may have been the issue. The new code was already running into the project scope, so I assumed it was the same, but guess not