Skip to content

Commit

Permalink
Merge branch 'main' into feat/added_diff_on_cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoso authored Dec 10, 2024
2 parents 1878230 + 06ba27c commit e014075
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 279 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/dependabot.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins:
- - "@google/semantic-release-replace-plugin"
- replacements:
- files:
- "build.gradle"
- "build.gradle.kts"
from: "\\bversion = '.*'"
to: "version = '${nextRelease.version}'"
- files:
- "build.gradle"
- "build.gradle.kts"
from: "com.google.maps.android:android-maps-utils:([0-9]+).([0-9]+).([0-9]+)"
to: "com.google.maps.android:android-maps-utils:${nextRelease.version}'"
- files:
Expand All @@ -23,7 +23,7 @@ plugins:
publishCmd: "./gradlew publish --warn --stacktrace"
- - "@semantic-release/git"
- assets:
- "build.gradle"
- "build.gradle.kts"
- "*.md"
- "@semantic-release/github"
options:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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.9.0'
implementation 'com.google.maps.android:android-maps-utils:3.10.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
2 changes: 2 additions & 0 deletions build-logic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/build
.gradle
42 changes: 42 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
`kotlin-dsl`
}

repositories {
google()
mavenCentral()
gradlePluginPortal()
}


dependencies {
implementation(libs.kotlin.gradle.plugin)
implementation(libs.gradle)
implementation(libs.dokka.gradle.plugin)
implementation(libs.org.jacoco.core)
}

gradlePlugin {
plugins {
register("publishingConventionPlugin") {
id = "android.maps.utils.PublishingConventionPlugin"
implementationClass = "PublishingConventionPlugin"
}
}
}
124 changes: 124 additions & 0 deletions build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// buildSrc/src/main/kotlin/PublishingConventionPlugin.kt
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()
}
}

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")
}

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

}

tasks.withType<Test>().configureEach {
extensions.configure(JacocoTaskExtension::class.java) {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}
}

private fun Project.configurePublishing() {
extensions.configure<com.android.build.gradle.LibraryExtension> {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
extensions.configure<PublishingExtension> {
publications {
create<MavenPublication>("aar") {
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.")
}
}
}
}
}
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?
}
}
}
}
}

private fun Project.configureSigning() {
configure<SigningExtension> {
sign(extensions.getByType<PublishingExtension>().publications["aar"])
}
}
}
30 changes: 30 additions & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

rootProject.name = "build-logic"
include(":convention")
Loading

0 comments on commit e014075

Please sign in to comment.