From 3b9022cd1f7178230a7665848e6c8df54ae21bb7 Mon Sep 17 00:00:00 2001 From: Jaeung Cheon Date: Sat, 31 Aug 2024 14:46:44 +0900 Subject: [PATCH] Apply maven central publishing plugin --- build.gradle.kts | 1 + gradle/libs.versions.toml | 1 + simplecarousel/build.gradle.kts | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index b75c35a..1475c28 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,7 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.maven.publish) apply false } allprojects { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 364f883..c26485f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,6 +6,7 @@ androidGradlePlugin = "8.5.1" kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +maven-publish = { id = "com.vanniktech.maven.publish", version = "0.28.0" } [libraries] # Library Dependencies diff --git a/simplecarousel/build.gradle.kts b/simplecarousel/build.gradle.kts index 26bb5c8..ef93904 100644 --- a/simplecarousel/build.gradle.kts +++ b/simplecarousel/build.gradle.kts @@ -1,6 +1,9 @@ +import com.vanniktech.maven.publish.SonatypeHost + plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) + alias(libs.plugins.maven.publish) } android { @@ -26,3 +29,36 @@ dependencies { implementation(libs.androidx.core) api(libs.androidx.recyclerview) } + +mavenPublishing { + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) + signAllPublications() + coordinates("${project.group}", "simplecarousel", "${project.version}") + + pom { + name.set("SimpleCarousel for Android") + description.set("Simple components to make carousel UI for Android.") + url.set("https://github.com/cheonjaeung/simplecarousel-android") + + licenses { + license { + name.set("Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + + developers { + developer { + id.set("cheonjaeung") + name.set("Jaeung Cheon") + email.set("cheonjaewoong@gmail.com") + } + } + + scm { + url.set("https://github.com/cheonjaeung/simplecarousel-android") + connection.set("scm:git:git://github.com/cheonjaeung/simplecarousel-android.git") + developerConnection.set("scm:git:ssh://git@github.com/cheonjaeung/simplecarousel-android.git") + } + } +}