1- import java.util.Properties
1+ import com.vanniktech.maven.publish.SonatypeHost
22
33plugins {
44 alias(libs.plugins.android.library)
55 alias(libs.plugins.kotlin.android)
6-
7- id(" maven-publish" )
6+ alias(libs.plugins.vanniktech.maven.publish)
87}
98
109android {
@@ -40,13 +39,6 @@ android {
4039 composeOptions {
4140 kotlinCompilerExtensionVersion = " 1.5.4"
4241 }
43-
44- publishing {
45- singleVariant(" release" ) {
46- withSourcesJar()
47- withJavadocJar()
48- }
49- }
5042}
5143
5244dependencies {
@@ -60,22 +52,41 @@ dependencies {
6052 androidTestImplementation(libs.androidx.espresso.core)
6153}
6254
63- afterEvaluate {
64- publishing {
65- publications {
66- create<MavenPublication >(" release" ) {
67- from(components[" release" ])
68- groupId = " com.donglab.devtools"
69- artifactId = " screennameviewer-compose-noop"
70- version = libs.versions.sdk.version.get()
55+ mavenPublishing {
56+ coordinates(
57+ groupId = " io.github.dongx0915" ,
58+ artifactId = " screennameviewer-compose-noop" ,
59+ version = libs.versions.sdk.version.get()
60+ )
61+
62+ pom {
63+ name.set(" ScreenNameViewer for Compose No-op" )
64+ description.set(" A debug library that displays the current Activity/Fragment and Compose screen route as an on-screen overlay." )
65+ url.set(" https://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose" )
66+ inceptionYear.set(" 2025" )
67+
68+ licenses {
69+ license {
70+ name.set(" The Apache Software License, Version 2.0" )
71+ url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
72+ }
73+ }
7174
72- // POM Metadata (Optional)
73- pom {
74- name.set(" ScreenNameViewer for Compose (No-op)" )
75- description.set(" No-operation version of ScreenNameViewer library for Jetpack Compose (for release builds)" )
76- url.set(" https://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose" )
77- }
75+ developers {
76+ developer {
77+ id.set(" dongx0915" )
78+ name.set(" Donghyeon Kim" )
79+ email.set(" donghyeon0915@gmail.com" )
7880 }
7981 }
82+
83+ scm {
84+ url.set(" https://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose" )
85+ connection.set(" scm:git:git://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose.git" )
86+ developerConnection.set(" scm:git:ssh://git@github.com/DongLab-DevTools/ScreenNameViewer-For-Compose.git" )
87+ }
8088 }
81- }
89+
90+ publishToMavenCentral(SonatypeHost .CENTRAL_PORTAL )
91+ signAllPublications()
92+ }
0 commit comments