Skip to content

Commit a7464a7

Browse files
authored
chore: fix publish command (#1450)
1 parent d437db4 commit a7464a7

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ class PublishingConventionPlugin : Plugin<Project> {
7171
extensions.configure<PublishingExtension> {
7272
publications {
7373
create<MavenPublication>("aar") {
74+
artifactId = if (project.name == "library") {
75+
"android-maps-utils"
76+
} else {
77+
null
78+
}
79+
7480
afterEvaluate {
7581
from(components["release"])
7682
}
@@ -104,9 +110,13 @@ class PublishingConventionPlugin : Plugin<Project> {
104110
}
105111
repositories {
106112
maven {
107-
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
108-
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
109-
url = if (project.version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
113+
val releasesRepoUrl =
114+
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
115+
val snapshotsRepoUrl =
116+
uri("https://oss.sonatype.org/content/repositories/snapshots/")
117+
url = if (project.version.toString()
118+
.endsWith("SNAPSHOT")
119+
) snapshotsRepoUrl else releasesRepoUrl
110120
credentials {
111121
username = project.findProperty("sonatypeToken") as String?
112122
password = project.findProperty("sonatypeTokenPassword") as String?

build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ tasks.register<Delete>("clean") {
3535
delete(rootProject.buildDir)
3636
}
3737

38-
3938
allprojects {
4039
group = "com.google.maps.android"
4140
version = "3.10.0"
42-
val projectArtifactId = if (project.name == "library") {
43-
"android-maps-utils"
44-
} else {
45-
null
46-
}
4741
}

0 commit comments

Comments
 (0)