love.forte.gradle.common.publication.configure.MavenJvmPublicationConfigures.kt Maven / Gradle / Ivy
package love.forte.gradle.common.publication.configure
import org.gradle.api.Project
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.create
fun Project.jvmConfigPublishing(block: MavenJvmPublishingConfigExtensions.() -> Unit = {}) {
val config = MavenJvmPublishingConfigExtensions().also(block)
publishingExtension {
it.commonConfigPublishingRepositories(config)
it.publications { pc ->
pc.create(config.publicationName) {
from(components.getByName("java"))
commonConfigMavenPublication(this@jvmConfigPublishing, config)
}
}
}
commonPublicationSignConfig(config)
}
open class MavenJvmPublishingConfigExtensions : MavenCommonPublishingConfigExtensions() {
var publicationName = "publicationDist"
}