Skip to content

Commit cc948a8

Browse files
committed
feat : 배포 방식 maven으로 변경
1 parent 7d78ef4 commit cc948a8

3 files changed

Lines changed: 75 additions & 50 deletions

File tree

gradle/libs.versions.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ composeUi = "1.5.0"
1515
activityCompose = "1.7.0"
1616
navigationCompose = "2.5.0"
1717

18+
# Maven
19+
vanniktechMavenPublish = "0.31.0"
20+
1821
# Test
1922
junit = "4.13.2"
2023
junitVersion = "1.1.3"
@@ -45,4 +48,4 @@ androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-co
4548
android-application = { id = "com.android.application", version.ref = "agp" }
4649
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
4750
android-library = { id = "com.android.library", version.ref = "agp" }
48-
51+
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktechMavenPublish" }

screennameviewer/compose-noop/build.gradle.kts

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import java.util.Properties
1+
import com.vanniktech.maven.publish.SonatypeHost
22

33
plugins {
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

109
android {
@@ -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

5244
dependencies {
@@ -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+
}

screennameviewer/compose/build.gradle.kts

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import java.util.Properties
1+
import com.vanniktech.maven.publish.SonatypeHost
22

33
plugins {
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

109
android {
@@ -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

5244
dependencies {
@@ -64,22 +56,41 @@ dependencies {
6456
androidTestImplementation(libs.androidx.espresso.core)
6557
}
6658

67-
afterEvaluate {
68-
publishing {
69-
publications {
70-
create<MavenPublication>("release") {
71-
from(components["release"])
72-
groupId = "com.donglab.devtools"
73-
artifactId = "screennameviewer-compose"
74-
version = libs.versions.sdk.version.get()
59+
mavenPublishing {
60+
coordinates(
61+
groupId = "io.github.dongx0915",
62+
artifactId = "screennameviewer-compose",
63+
version = libs.versions.sdk.version.get()
64+
)
65+
66+
pom {
67+
name.set("ScreenNameViewer for Compose")
68+
description.set("A debug library that displays the current Activity/Fragment and Compose screen route as an on-screen overlay.")
69+
url.set("https://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose")
70+
inceptionYear.set("2025")
7571

76-
// POM Metadata (Optional)
77-
pom {
78-
name.set("ScreenNameViewer for Compose")
79-
description.set("Screen name viewer library for Jetpack Compose")
80-
url.set("https://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose")
81-
}
72+
licenses {
73+
license {
74+
name.set("The Apache Software License, Version 2.0")
75+
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
8276
}
8377
}
78+
79+
developers {
80+
developer {
81+
id.set("dongx0915")
82+
name.set("Donghyeon Kim")
83+
email.set("donghyeon0915@gmail.com")
84+
}
85+
}
86+
87+
scm {
88+
url.set("https://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose")
89+
connection.set("scm:git:git://github.com/DongLab-DevTools/ScreenNameViewer-For-Compose.git")
90+
developerConnection.set("scm:git:ssh://git@github.com/DongLab-DevTools/ScreenNameViewer-For-Compose.git")
91+
}
8492
}
93+
94+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
95+
signAllPublications()
8596
}

0 commit comments

Comments
 (0)