From 127b9b20691f853e0311b374acac40e1f1689fa7 Mon Sep 17 00:00:00 2001 From: Ahmed El-Helw Date: Tue, 22 Oct 2024 18:47:44 +0300 Subject: [PATCH] Add a skip.signing parameter for local publishing (#306) * Add a skip.signing parameter for local publishing Today, due to the signing requirement, one can no longer publish to Maven local for testing without having credentials. This patch adds an optional flag for disabling signing for cases when someone wants to publish locally for testing. * Copy Renv updates into the guide --------- Co-authored-by: Ian Wagner --- android/README.md | 6 ++++++ android/build.gradle | 4 ++++ android/composeui/build.gradle | 4 +++- android/core/build.gradle | 4 +++- android/google-play-services/build.gradle | 4 +++- android/maplibreui/build.gradle | 5 ++++- guide/src/dev-env-setup.md | 4 ++++ 7 files changed, 27 insertions(+), 4 deletions(-) diff --git a/android/README.md b/android/README.md index 9ef07364..9db809b6 100644 --- a/android/README.md +++ b/android/README.md @@ -20,3 +20,9 @@ Set your API key in `local.properties` to run the demo app ```properties stadiaApiKey=YOUR-API-KEY ``` + +## Testing locally in a separate project + +* Bump the version number to a `SNAPSHOT` in `build.gradle`. +* run `./gradlew publishToMavenLocal -Pskip.signing` +* reference the updated version number in the project, and ensure that `mavenLocal` is one of the `repositories`. diff --git a/android/build.gradle b/android/build.gradle index 57a3e73e..fd537917 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -11,6 +11,10 @@ plugins { alias libs.plugins.kotlinSerialization apply false } +ext { + SKIP_SIGNING_PROPERTY = "skip.signing" +} + allprojects { group = "com.stadiamaps.ferrostar" version = "0.19.0" diff --git a/android/composeui/build.gradle b/android/composeui/build.gradle index 06941ed3..8e971cf7 100644 --- a/android/composeui/build.gradle +++ b/android/composeui/build.gradle @@ -68,7 +68,9 @@ dependencies { mavenPublishing { publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - signAllPublications() + if (!project.hasProperty(SKIP_SIGNING_PROPERTY)) { + signAllPublications() + } configure(new AndroidSingleVariantLibrary("release", true, true)) diff --git a/android/core/build.gradle b/android/core/build.gradle index 51771902..2c948171 100644 --- a/android/core/build.gradle +++ b/android/core/build.gradle @@ -102,7 +102,9 @@ android.libraryVariants.all { variant -> mavenPublishing { publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - signAllPublications() + if (!project.hasProperty(SKIP_SIGNING_PROPERTY)) { + signAllPublications() + } configure(new AndroidSingleVariantLibrary("release", true, true)) diff --git a/android/google-play-services/build.gradle b/android/google-play-services/build.gradle index 5ef53a92..17c765e6 100644 --- a/android/google-play-services/build.gradle +++ b/android/google-play-services/build.gradle @@ -47,7 +47,9 @@ dependencies { mavenPublishing { publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - signAllPublications() + if (!project.hasProperty(SKIP_SIGNING_PROPERTY)) { + signAllPublications() + } configure(new AndroidSingleVariantLibrary("release", true, true)) diff --git a/android/maplibreui/build.gradle b/android/maplibreui/build.gradle index 6e9b7534..0dd79f3b 100644 --- a/android/maplibreui/build.gradle +++ b/android/maplibreui/build.gradle @@ -65,7 +65,10 @@ dependencies { mavenPublishing { publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - signAllPublications() + + if (!project.hasProperty(SKIP_SIGNING_PROPERTY)) { + signAllPublications() + } configure(new AndroidSingleVariantLibrary("release", true, true)) diff --git a/guide/src/dev-env-setup.md b/guide/src/dev-env-setup.md index da45a280..ca0233f1 100644 --- a/guide/src/dev-env-setup.md +++ b/guide/src/dev-env-setup.md @@ -122,6 +122,10 @@ cargo install cargo-ndk 4. Open the Gradle workspace ('android/') in Android Studio. Gradle builds automatically ensure the core is built, so there are no funky scripts needed as on iOS. +5. (Optional) If you want to use Maven local publishing to test... + - Bump the version number to a `SNAPSHOT` in `build.gradle`. + - run `./gradlew publishToMavenLocal -Pskip.signing`. + - Reference the updated version number in the project, and ensure that `mavenLocal` is one of the `repositories`. #### PR checklist