Skip to content

Commit

Permalink
Add a skip.signing parameter for local publishing (#306)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
ahmedre and ianthetechie authored Oct 22, 2024
1 parent 08898d5 commit 127b9b2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 4 deletions.
6 changes: 6 additions & 0 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
4 changes: 4 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion android/composeui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ dependencies {

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
if (!project.hasProperty(SKIP_SIGNING_PROPERTY)) {
signAllPublications()
}

configure(new AndroidSingleVariantLibrary("release", true, true))

Expand Down
4 changes: 3 additions & 1 deletion android/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 3 additions & 1 deletion android/google-play-services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ dependencies {

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
if (!project.hasProperty(SKIP_SIGNING_PROPERTY)) {
signAllPublications()
}

configure(new AndroidSingleVariantLibrary("release", true, true))

Expand Down
5 changes: 4 additions & 1 deletion android/maplibreui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ dependencies {

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()

if (!project.hasProperty(SKIP_SIGNING_PROPERTY)) {
signAllPublications()
}

configure(new AndroidSingleVariantLibrary("release", true, true))

Expand Down
4 changes: 4 additions & 0 deletions guide/src/dev-env-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 127b9b2

Please sign in to comment.