Don't set the default Maven coordinates that are derived from project
In Gradle, a publication's Maven coordinates are by default derived from the project. Setting them explicitly breaks the link, and the coordinates are no more updated when the project's group and version change. Setting the coordinates in our code breaks with Gradle Kotlin DSL, where the plugin is applied before the build script can even update the project's group and version -- our code could set empty values, which would update no more. Not setting them helps: the values are still delegated to the project.
This commit is contained in:
-5
@@ -162,9 +162,6 @@ class KotlinMultiplatformPlugin(
|
||||
val rootPublication = publishing.publications.create("kotlinMultiplatform", MavenPublication::class.java).apply {
|
||||
from(kotlinSoftwareComponent)
|
||||
(this as MavenPublicationInternal).publishWithOriginalFileName()
|
||||
artifactId = project.name
|
||||
groupId = project.group.toString()
|
||||
version = project.version.toString()
|
||||
}
|
||||
|
||||
// Publish the root publication only if Gradle metadata publishing is enabled:
|
||||
@@ -186,8 +183,6 @@ class KotlinMultiplatformPlugin(
|
||||
}
|
||||
(this as MavenPublicationInternal).publishWithOriginalFileName()
|
||||
artifactId = variant.target.defaultArtifactId
|
||||
groupId = project.group.toString()
|
||||
version = project.version.toString()
|
||||
}
|
||||
|
||||
variant.publicationDelegate = variantPublication
|
||||
|
||||
Reference in New Issue
Block a user