build-logic: switch to full publish plugin

This commit is contained in:
Harsh Shandilya 2022-06-20 14:25:57 +05:30
parent 50c99d6190
commit c625b2114a
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -2,9 +2,8 @@
package dev.msfjarvis.aps.gradle package dev.msfjarvis.aps.gradle
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.MavenPublishBaseExtension import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishBasePlugin import com.vanniktech.maven.publish.MavenPublishPlugin
import com.vanniktech.maven.publish.SonatypeHost import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.Plugin import org.gradle.api.Plugin
import org.gradle.api.Project import org.gradle.api.Project
@ -20,14 +19,12 @@ class PublishedAndroidLibraryPlugin : Plugin<Project> {
override fun apply(project: Project) { override fun apply(project: Project) {
project.plugins.run { project.plugins.run {
apply(LibraryPlugin::class) apply(LibraryPlugin::class)
apply(MavenPublishBasePlugin::class) apply(MavenPublishPlugin::class)
apply(SigningPlugin::class) apply(SigningPlugin::class)
} }
project.extensions.getByType<MavenPublishBaseExtension>().run { project.extensions.getByType<MavenPublishBaseExtension>().run {
publishToMavenCentral(SonatypeHost.DEFAULT) publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications() signAllPublications()
configure(AndroidSingleVariantLibrary())
pomFromGradleProperties()
} }
project.afterEvaluate { project.afterEvaluate {
project.extensions.getByType<SigningExtension>().run { project.extensions.getByType<SigningExtension>().run {