Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/lint-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ jobs:
- name: Run Android Lint
run: ./gradlew lint

- name: Merge SARIF files
run: |
jq -s '{ "$schema": "https://json.schemastore.org/sarif-2.1.0", "version": "2.1.0", "runs": map(.runs) | add }' library/build/reports/lint-results-debug.sarif demo/build/reports/lint-results-debug.sarif > merged.sarif
- name: Upload SARIF for library
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: library/build/reports/lint-results-debug.sarif
category: library

- name: Upload SARIF file
- name: Upload SARIF for demo
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: merged.sarif
sarif_file: demo/build/reports/lint-results-debug.sarif
category: demo
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ jobs:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/wrapper-validation@v4
- name: Create .gpg key
- name: Set up Gradle Publishing Environment Variables
run: |
echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc

echo "Build and publish"
sed -i -e "s,sonatypeToken=,sonatypeToken=$SONATYPE_TOKEN_USERNAME,g" gradle.properties
sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_TOKEN_USERNAME,g" gradle.properties
SONATYPE_TOKEN_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_TOKEN_PASSWORD" | sed -e 's/[\/&]/\\&/g')
sed -i -e "s,sonatypeTokenPassword=,sonatypeTokenPassword=$SONATYPE_TOKEN_PASSWORD_ESCAPED,g" gradle.properties
sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_TOKEN_PASSWORD_ESCAPED,g" gradle.properties
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties
sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties
env:
GPG_KEY_ARMOR: "${{ secrets.SYNCED_GPG_KEY_ARMOR }}"
GPG_KEY_ARMOR: ${{ secrets.SYNCED_GPG_KEY_ARMOR }}
GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }}
GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }}
SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
Expand All @@ -56,7 +56,7 @@ jobs:
node-version: '14'

- name: Semantic Release
uses: cycjimmy/[email protected].0
uses: cycjimmy/[email protected].2
with:
extra_plugins: |
"@semantic-release/[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

- name: Jacoco Report to PR
id: jacoco
uses: madrapps/[email protected].1
uses: madrapps/[email protected].2
with:
paths: |
${{ github.workspace }}/library/build/jacoco/jacoco.xml
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins:
to: ":${nextRelease.version}"
- - "@semantic-release/exec"
- prepareCmd: "./gradlew build --warn --stacktrace"
publishCmd: "./gradlew publish --warn --stacktrace --debug --info"
publishCmd: "./gradlew publishToMavenCentral --warn --stacktrace --debug --info"
- - "@semantic-release/git"
- assets:
- "build.gradle.kts"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
// Utilities for Maps SDK for Android (requires Google Play Services)
// You do not need to add a separate dependency for the Maps SDK for Android
// since this library builds in the compatible version of the Maps SDK.
implementation 'com.google.maps.android:android-maps-utils:3.13.0'
implementation 'com.google.maps.android:android-maps-utils:3.14.0'

// Optionally add the Kotlin Extensions (KTX) for full Kotlin language support
// See latest version at https://github.com/googlemaps/android-maps-ktx
Expand Down Expand Up @@ -131,6 +131,8 @@ Contributions are welcome and encouraged! If you'd like to contribute, send us a

This library uses Google Maps Platform services. Use of Google Maps Platform services through this library is subject to the Google Maps Platform [Terms of Service].

If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq).

This library is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this library.

## Support
Expand Down
1 change: 1 addition & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
implementation(libs.gradle)
implementation(libs.dokka.gradle.plugin)
implementation(libs.org.jacoco.core)
implementation(libs.gradle.maven.publish.plugin)
}

gradlePlugin {
Expand Down
114 changes: 39 additions & 75 deletions build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,40 +15,34 @@
*/

// buildSrc/src/main/kotlin/PublishingConventionPlugin.kt
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.*
import org.gradle.testing.jacoco.plugins.JacocoPluginExtension
import org.gradle.api.tasks.testing.Test
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension
import org.gradle.plugins.signing.SigningExtension
import org.gradle.api.publish.maven.*

class PublishingConventionPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.run {

applyPlugins()
configureJacoco()
configurePublishing()
configureSigning()
configureVanniktechPublishing()
}
}

private fun Project.applyPlugins() {
apply(plugin = "com.android.library")
apply(plugin = "com.mxalbert.gradle.jacoco-android")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "signing")
apply(plugin = "com.vanniktech.maven.publish")
}

private fun Project.configureJacoco() {
configure<JacocoPluginExtension> {
toolVersion = "0.8.7"

}

tasks.withType<Test>().configureEach {
Expand All @@ -59,76 +53,46 @@ class PublishingConventionPlugin : Plugin<Project> {
}
}

private fun Project.configurePublishing() {
extensions.configure<com.android.build.gradle.LibraryExtension> {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
extensions.configure<PublishingExtension> {
publications {
create<MavenPublication>("aar") {
artifactId = if (project.name == "library") {
"android-maps-utils"
} else {
null
}
private fun Project.configureVanniktechPublishing() {
extensions.configure<MavenPublishBaseExtension> {
configure(
AndroidSingleVariantLibrary(
variant = "release",
sourcesJar = true,
publishJavadocJar = true
)
)

afterEvaluate {
from(components["release"])
}
pom {
name.set(project.name)
description.set("Handy extensions to the Google Maps Android API.")
url.set("https://github.com/googlemaps/android-maps-utils")
scm {
connection.set("scm:[email protected]:googlemaps/android-maps-utils.git")
developerConnection.set("scm:[email protected]:googlemaps/android-maps-utils.git")
url.set("scm:[email protected]:googlemaps/android-maps-utils.git")
}
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
organization {
name.set("Google Inc")
url.set("http://developers.google.com/maps")
}
developers {
developer {
name.set("Google Inc.")
}
}
publishToMavenCentral()
signAllPublications()

pom {
name.set(project.name)
description.set("Handy extensions to the Google Maps Android API.")
url.set("https://github.com/googlemaps/android-maps-utils")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
}
repositories {
maven {
val releasesRepoUrl =
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl =
uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = if (project.version.toString()
.endsWith("SNAPSHOT")
) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = project.findProperty("sonatypeToken") as String?
password = project.findProperty("sonatypeTokenPassword") as String?
scm {
connection.set("scm:[email protected]:googlemaps/android-maps-utils.git")
developerConnection.set("scm:[email protected]:googlemaps/android-maps-utils.git")
url.set("https://github.com/googlemaps/android-maps-utils")
}
developers {
developer {
id.set("google")
name.set("Google Inc.")
}
}
organization {
name.set("Google Inc")
url.set("http://developers.google.com/maps")
}
}
}
}

private fun Project.configureSigning() {
configure<SigningExtension> {
sign(extensions.getByType<PublishingExtension>().publications["aar"])
}
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ tasks.register<Delete>("clean") {

allprojects {
group = "com.google.maps.android"
version = "3.13.0"
version = "3.14.0"
}
4 changes: 2 additions & 2 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ android {
}

defaultConfig {
compileSdk = 35
compileSdk = libs.versions.compileSdk.get().toInt()
applicationId = "com.google.maps.android.utils.demo"
minSdk = 21
targetSdk = 35
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
Expand Down
10 changes: 7 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ signing.keyId=
signing.password=
signing.secretKeyRingFile=

sonatypeToken=
sonatypeTokenPassword=

android.defaults.buildfeatures.buildconfig=true

mavenCentralUsername=
mavenCentralPassword=

# Add a property to enable automatic release to Maven Central (optional, but good for CI)
# If true, publishToMavenCentral will also close and release the staging repository
mavenCentralAutomaticRelease=false
22 changes: 13 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
[versions]
appcompat = "1.7.0"
compileSdk = "36"
targetSdk = "36"
appcompat = "1.7.1"
dokka-gradle-plugin = "2.0.0"
gradle = "8.9.1"
gradle = "8.12.0"
jacoco-android = "0.2.1"
lifecycle-extensions = "2.2.0"
lifecycle-viewmodel-ktx = "2.9.0"
kotlin = "2.1.20"
lifecycle-viewmodel-ktx = "2.9.2"
kotlin = "2.2.0"
kotlinx-coroutines = "1.10.2"
junit = "4.13.2"
mockito-core = "5.17.0"
mockito-core = "5.18.0"
secrets-gradle-plugin = "2.0.1"
truth = "1.4.4"
play-services-maps = "19.2.0"
core-ktx = "1.16.0"
robolectric = "4.14.1"
robolectric = "4.15.1"
kxml2 = "2.3.0"
mockk = "1.14.2"
lint = "31.10.0"
mockk = "1.14.5"
lint = "31.12.0"
org-jacoco-core = "0.8.13"
material = "1.12.0"
gradleMavenPublishPlugin = "0.34.0"

[libraries]
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
Expand Down Expand Up @@ -47,4 +50,5 @@ lint = { module = "com.android.tools.lint:lint", version.ref = "lint" }
lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "lint" }
testutils = { module = "com.android.tools:testutils", version.ref = "lint" }
org-jacoco-core = { module = "org.jacoco:org.jacoco.core", version.ref = "org-jacoco-core" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
gradle-maven-publish-plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradleMavenPublishPlugin" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ android {
sarifOutput = file("$buildDir/reports/lint-results.sarif")
}
defaultConfig {
compileSdk = 35
compileSdk = libs.versions.compileSdk.get().toInt()
minSdk = 21
targetSdk = 35
targetSdk = libs.versions.targetSdk.get().toInt()
consumerProguardFiles("consumer-rules.pro")
buildConfigField("String", "TRAVIS", "\"${System.getenv("TRAVIS")}\"")
}
Expand Down
Loading