Skip to content

Commit 3bd622c

Browse files
committed
feat: add BoM module and fix artifactIds
* Adds a new module applying the plugin * Adds to standardise publishing of the BoM * Fixes an issue where all modules were being published with the legacy artifact ID, which would cause them to overwrite each other on Maven Central. Modules are now published as , , etc. while correctly retains .
1 parent 0be1bc6 commit 3bd622c

5 files changed

Lines changed: 92 additions & 2 deletions

File tree

bom/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
id("android.maps.utils.BomPublishingConventionPlugin")
3+
}
4+
5+
dependencies {
6+
constraints {
7+
api(project(":clustering"))
8+
api(project(":data"))
9+
api(project(":heatmaps"))
10+
api(project(":library"))
11+
api(project(":onion"))
12+
api(project(":ui"))
13+
api(project(":visual-testing"))
14+
}
15+
}

build-logic/convention/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,9 @@ gradlePlugin {
3939
id = "android.maps.utils.PublishingConventionPlugin"
4040
implementationClass = "PublishingConventionPlugin"
4141
}
42+
register("bomPublishingConventionPlugin") {
43+
id = "android.maps.utils.BomPublishingConventionPlugin"
44+
implementationClass = "BomPublishingConventionPlugin"
45+
}
4246
}
4347
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import com.vanniktech.maven.publish.MavenPublishBaseExtension
18+
import org.gradle.api.Plugin
19+
import org.gradle.api.Project
20+
import org.gradle.kotlin.dsl.*
21+
22+
class BomPublishingConventionPlugin : Plugin<Project> {
23+
override fun apply(project: Project) {
24+
project.run {
25+
apply(plugin = "java-platform")
26+
apply(plugin = "com.vanniktech.maven.publish")
27+
28+
extensions.configure<MavenPublishBaseExtension> {
29+
publishToMavenCentral()
30+
signAllPublications()
31+
32+
coordinates(
33+
artifactId = "maps-utils-bom",
34+
)
35+
36+
pom {
37+
name.set("android-maps-utils-bom")
38+
description.set("BoM for android-maps-utils")
39+
url.set("https://github.com/googlemaps/android-maps-utils")
40+
licenses {
41+
license {
42+
name.set("The Apache Software License, Version 2.0")
43+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
44+
distribution.set("repo")
45+
}
46+
}
47+
scm {
48+
connection.set("scm:git@github.com:googlemaps/android-maps-utils.git")
49+
developerConnection.set("scm:git@github.com:googlemaps/android-maps-utils.git")
50+
url.set("https://github.com/googlemaps/android-maps-utils")
51+
}
52+
developers {
53+
developer {
54+
id.set("google")
55+
name.set("Google LLC")
56+
}
57+
}
58+
organization {
59+
name.set("Google Inc")
60+
url.set("http://developers.google.com/maps")
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,13 @@ class PublishingConventionPlugin : Plugin<Project> {
6666
publishToMavenCentral()
6767
signAllPublications()
6868

69+
val artifactName = if (project.name == "library") {
70+
"android-maps-utils"
71+
} else {
72+
"maps-utils-${project.name}"
73+
}
6974
coordinates(
70-
artifactId = "android-maps-utils",
75+
artifactId = artifactName,
7176
)
7277

7378
pom {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ pluginManagement {
2929
}
3030
}
3131

32-
include("demo", "clustering", "heatmaps", "ui", "data", "lint-checks", "library", "onion", "visual-testing")
32+
include("demo", "clustering", "heatmaps", "ui", "data", "lint-checks", "library", "onion", "visual-testing", "bom")

0 commit comments

Comments
 (0)