From 1772889a16e5156493f6fbd9631df5a859b9813a Mon Sep 17 00:00:00 2001 From: Ahmed El-Helw Date: Tue, 22 Oct 2024 19:02:08 +0400 Subject: [PATCH 1/2] 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. --- 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 ++++- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/android/README.md b/android/README.md index 356bb4ce..befa1823 100644 --- a/android/README.md +++ b/android/README.md @@ -19,3 +19,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 0a91c0a6..22507342 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.18.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)) From cd6a0b7a8c87660541f7b0ed4f3e9362d947c693 Mon Sep 17 00:00:00 2001 From: Ian Wagner Date: Wed, 23 Oct 2024 00:12:42 +0900 Subject: [PATCH 2/2] Copy Renv updates into the guide --- guide/src/dev-env-setup.md | 4 ++++ 1 file changed, 4 insertions(+) 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