Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc

echo "Build and publish"
sed -i -e "s,sonatypeUsername=,sonatypeUsername=$SONATYPE_USERNAME,g" gradle.properties
sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_USERNAME,g" gradle.properties
SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g')
sed -i -e "s,sonatypePassword=,sonatypePassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties
sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_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
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ secure.properties

# macOS-specific files
.DS_Store

.kotlin
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins:
to: ":${nextRelease.version}"
- - "@semantic-release/exec"
- prepareCmd: "./gradlew build --warn --stacktrace"
publishCmd: "./gradlew publish --warn --stacktrace"
publishCmd: "./gradlew publishToMavenCentral --warn --stacktrace"
- - "@semantic-release/git"
- assets:
- "build.gradle.kts"
Expand Down
111 changes: 34 additions & 77 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import com.google.maps.android.rx.androidExtension
import com.google.maps.android.rx.artifactId
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.gradle.api.tasks.testing.Test
import org.gradle.testing.jacoco.plugins.JacocoPluginExtension
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension


// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
Expand All @@ -32,12 +35,11 @@ buildscript {
}

plugins {
`maven-publish`
signing
id("org.jetbrains.dokka") version "2.0.0"
id("com.vanniktech.maven.publish") version "0.34.0" apply false
}

// Shared configs across subprojects
// Shared configs
allprojects {
group = "com.google.maps.android"
version = "1.0.0"
Expand All @@ -54,21 +56,13 @@ subprojects {

apply(plugin = "com.android.library")
apply(plugin = "kotlin-android")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "signing")
apply(plugin = "com.vanniktech.maven.publish")
apply(plugin = "com.mxalbert.gradle.jacoco-android")


val sourcesJar = task<Jar>("sourcesJar") {
archiveClassifier.set("sources")
val libraryExtension = (project.androidExtension as com.android.build.gradle.LibraryExtension)
from(libraryExtension.sourceSets["main"].java.srcDirs)
}

// Jacoco setup
configure<JacocoPluginExtension> {
toolVersion = "0.8.7"

}

tasks.withType<Test>().configureEach {
Expand All @@ -78,77 +72,40 @@ subprojects {
}
}

extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral()
signAllPublications()

val dokkaHtml = tasks.named<org.jetbrains.dokka.gradle.DokkaTask>("dokkaHtml")
val dokkaJavadoc = tasks.named<org.jetbrains.dokka.gradle.DokkaTask>("dokkaJavadoc")
val javadocJar = task<Jar>("javadocJar") {
dependsOn(dokkaHtml)
dependsOn(dokkaJavadoc)
archiveClassifier.set("javadoc")
from(buildDir.resolve("dokka/javadoc"))
}
pom {
name.set(project.name)
description.set("RxJava bindings for the Maps SDK for Android")
url.set("https://github.com/googlemaps/android-maps-rx")

publishing {
publications {
create<MavenPublication>("aar") {
groupId = project.group as String
artifactId = project.artifactId
version = project.version as String

pom {
name.set(project.name)
description.set("RxJava bindings for the Maps SDK for Android")
url.set("https://github.com/googlemaps/android-maps-rx")

scm {
connection.set("scm:git@github.com:googlemaps/android-maps-rx.git")
developerConnection.set("scm:git@github.com:googlemaps/android-maps-rx.git")
url.set("https://github.com/googlemaps/android-maps-rx")
}

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("https://developers.google.com/maps")
}

developers {
developer {
name.set("Google Inc.")
}
}
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")
}
}

afterEvaluate {
artifact(buildDir.resolve("outputs/aar/${project.name}-release.aar"))
scm {
connection.set("scm:git@github.com:googlemaps/android-maps-rx.git")
developerConnection.set("scm:git@github.com:googlemaps/android-maps-rx.git")
url.set("https://github.com/googlemaps/android-maps-rx")
}

artifact(javadocJar)
artifact(sourcesJar)
}
organization {
name.set("Google Inc.")
url.set("https://developers.google.com/maps")
}
}

repositories {
maven {
name = "mavencentral"
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
credentials {
username = properties["sonatypeUsername"] as String?
password = properties["sonatypePassword"] as String
developers {
developer {
id.set("google")
name.set("Google Inc.")
}
}
}
}

// Signing
signing {
sign(publishing.publications.findByName("aar"))
}
}
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ signing.keyId=
signing.password=
signing.secretKeyRingFile=

sonatypeUsername=
sonatypePassword=
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
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mapsKtx = "5.2.0"
volley = "1.2.1"
mapsRx = "1.0.0"
placesRx = "1.0.0"
gradleMavenPublishPlugin = "0.34.0"

[libraries]
mapsRx = { module = "com.google.maps.android:maps-rx", version.ref = "mapsRx" }
Expand All @@ -36,4 +37,5 @@ kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", v
dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka-gradle-plugin" }
jacoco-android = { module = "com.mxalbert.gradle:jacoco-android", version.ref = "jacoco-android" }
secrets-gradle-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secrets-gradle-plugin" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
gradle-maven-publish-plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradleMavenPublishPlugin" }
Loading