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
17 changes: 16 additions & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,24 @@ jobs:
run: |
echo "${{ steps.compose-version.outputs.new-version }}" > VERSION

- name: Publish to Maven local (smoke test)
- name: Publish core to Maven local (smoke test)
run: ./gradlew publishMavenPublicationToMavenLocal -PVERSION=${{ steps.compose-version.outputs.new-version }} --no-build-cache

- name: Publish aggregate kits to Maven local (smoke test)
run: ./gradlew publishMavenPublicationToMavenLocal -PVERSION=${{ steps.compose-version.outputs.new-version }} -c settings-kits.gradle --no-build-cache

- name: Publish isolated kit to Maven local (urbanairship-20 smoke test)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/urbanairship/urbanairship-20 -PVERSION=${{ steps.compose-version.outputs.new-version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Publish isolated kit to Maven local (braze-43 smoke test)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/braze/braze-43 -PVERSION=${{ steps.compose-version.outputs.new-version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Publish isolated kit to Maven local (ga-23 smoke test)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/ga/ga-23 -PVERSION=${{ steps.compose-version.outputs.new-version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Publish isolated kit to Maven local (ga4-23 smoke test)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/ga4/ga4-23 -PVERSION=${{ steps.compose-version.outputs.new-version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Generate changelog entry
id: changelog
# Pinned SHA for Semgrep (no mutable @main); bump when upgrading the action.
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ jobs:
- name: Publish core to Maven local (required before kits can compile)
run: ./gradlew publishMavenPublicationToMavenLocal -PVERSION=${{ needs.setup-and-version.outputs.final_version }} --no-build-cache

- name: Validate aggregate kit publications in Maven local
run: ./gradlew publishMavenPublicationToMavenLocal -PVERSION=${{ needs.setup-and-version.outputs.final_version }} -c settings-kits.gradle --no-build-cache

- name: Validate isolated kit publication (urbanairship-20)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/urbanairship/urbanairship-20 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Validate isolated kit publication (braze-43)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/braze/braze-43 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Validate isolated kit publication (ga-23)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/ga/ga-23 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Validate isolated kit publication (ga4-23)
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/ga4/ga4-23 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenLocal --no-build-cache

- name: Publish core to Maven Central
run: ./gradlew publishMavenPublicationToMavenCentralRepository -PVERSION=${{ needs.setup-and-version.outputs.final_version }} --no-build-cache

Expand All @@ -65,16 +80,16 @@ jobs:
# Isolated Kotlin 2.2.x kits are excluded from settings-kits.gradle and must be
# published from their own project roots (same pattern as CI test/lint steps).
- name: Publish Isolated Kits (urbanairship-20)
run: ./gradlew -p kits/urbanairship/urbanairship-20 -PisRelease=true -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/urbanairship/urbanairship-20 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache

- name: Publish Isolated Kits (braze-43)
run: ./gradlew -p kits/braze/braze-43 -PisRelease=true -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/braze/braze-43 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache

- name: Publish Isolated Kits (ga-23)
run: ./gradlew -p kits/ga/ga-23 -PisRelease=true -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/ga/ga-23 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache

- name: Publish Isolated Kits (ga4-23)
run: ./gradlew -p kits/ga4/ga4-23 -PisRelease=true -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache
run: ./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true -p kits/ga4/ga4-23 -PVERSION=${{ needs.setup-and-version.outputs.final_version }} publishMavenPublicationToMavenCentralRepository --no-build-cache
Comment thread
cursor[bot] marked this conversation as resolved.

# rokt-sdk-plus (com.rokt:rokt-sdk-plus) is an umbrella over the mParticle Rokt kit + the
# Rokt Payment Extension. The "Publish core to Maven local" step above already placed
Expand Down
32 changes: 19 additions & 13 deletions ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ Now we will build our Local Maven repository, this will allow us to make changes
publish it locally so that we can test them.

Run the following command in the terminal:
`./gradlew buildLocal`
`./gradlew -PisRelease=true clean publishReleaseLocal`
`./gradlew clean publishMavenPublicationToMavenLocal -PVERSION="$(head -n 1 VERSION)"`

This will publish the core modules to mavenLocal(), you should see all .pom and .aar files located
in your local /.m2 folder.)
Expand Down Expand Up @@ -128,7 +127,7 @@ This will ensure faster running times and easier error troubleshooting.

Now run the following command in the terminal:

`./gradlew -PisRelease=true clean testRelease publishReleaseLocal -c settings-kits.gradle`
`./gradlew clean testRelease publishMavenPublicationToMavenLocal -PVERSION="$(head -n 1 VERSION)" -c settings-kits.gradle`

You can now work on the specific kits you need, test them and even contribute through pull requests.

Expand All @@ -146,22 +145,29 @@ Kotlin version.
- `kits/ga/ga-23` (Kotlin 2.2.x, `firebase-analytics:23.x`)
- `kits/ga4/ga4-23` (Kotlin 2.2.x, `firebase-analytics:23.x`)

To build an isolated kit after publishing core to mavenLocal:
To build an isolated kit after publishing core to mavenLocal, run from the repository root:

```bash
cd kits/urbanairship/urbanairship-20
./gradlew testRelease publishReleaseLocal
./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true \
-p kits/urbanairship/urbanairship-20 \
-PVERSION="$(head -n 1 VERSION)" \
testRelease publishMavenPublicationToMavenLocal
```

The kit resolves `android-kit-base` from mavenLocal, so you must publish
the core first (`./gradlew -PisRelease=true publishReleaseLocal`).
the core first with the same exact `VERSION`.

To verify all kits (main + isolated):

```bash
./gradlew -PisRelease=true publishReleaseLocal
./gradlew -PisRelease=true testRelease publishReleaseLocal -c settings-kits.gradle
cd kits/urbanairship/urbanairship-20 && ./gradlew -PisRelease=true testRelease
./gradlew publishMavenPublicationToMavenLocal -PVERSION="$(head -n 1 VERSION)"
./gradlew testRelease publishMavenPublicationToMavenLocal \
-PVERSION="$(head -n 1 VERSION)" \
-c settings-kits.gradle
./gradlew -Pmparticle.kit.mparticleFromMavenLocalOnly=true \
-p kits/urbanairship/urbanairship-20 \
-PVERSION="$(head -n 1 VERSION)" \
testRelease publishMavenPublicationToMavenLocal
```

**Adding a new isolated kit:** If a kit upgrades to a Kotlin version
Expand All @@ -170,9 +176,9 @@ incompatible with the root KGP (2.1.20), remove it from
to the CI workflows following the urbanairship pattern. Also add a
matching isolated publish step in `.github/workflows/release-publish.yml`
(the aggregate `settings-kits.gradle` publish will not include it).
If the kit's standalone `rootProject.name` differs from the Maven
artifact id consumers expect, set `mparticleMavenPublish.artifactId`
explicitly in the kit `build.gradle` (see `braze-43`).
Include `build-logic` from the standalone settings file, declare the shared
publication plugin with `apply false`, and set `mparticleMavenPublish.artifactId`
explicitly in the kit `build.gradle`.

## Read More

Expand Down
50 changes: 27 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,33 @@ dependencies {
Kits maintained by mParticle are developed in this monorepo under the [`kits/`](kits) directory and deployed as individual Maven Central
artifacts. The table below lists kits with a final v6 artifact available on Maven Central:

| Kit | Maven artifact |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| [Adjust](kits/adjust/adjust-5) | [`com.mparticle:adjust-5`](https://central.sonatype.com/artifact/com.mparticle/adjust-5) |
| [Adobe](kits/adobe/adobe) | [`com.mparticle:adobe`](https://central.sonatype.com/artifact/com.mparticle/adobe) |
| [AppsFlyer](kits/appsflyer/appsflyer-6) | [`com.mparticle:appsflyer-6`](https://central.sonatype.com/artifact/com.mparticle/appsflyer-6) |
| [Apptentive](kits/apptentive/apptentive-6) | [`com.mparticle:apptentive-6`](https://central.sonatype.com/artifact/com.mparticle/apptentive-6) |
| [Apptimize](kits/apptimize/apptimize-3) | [`com.mparticle:apptimize-3`](https://central.sonatype.com/artifact/com.mparticle/apptimize-3) |
| [Branch Metrics](kits/branch/branch-5) | [`com.mparticle:branch-5`](https://central.sonatype.com/artifact/com.mparticle/branch-5) |
| [Braze 38](kits/braze/braze-38) | [`com.mparticle:braze-38`](https://central.sonatype.com/artifact/com.mparticle/braze-38) |
| [Braze 39](kits/braze/braze-39) | [`com.mparticle:braze-39`](https://central.sonatype.com/artifact/com.mparticle/braze-39) |
| [Braze 40](kits/braze/braze-40) | [`com.mparticle:braze-40`](https://central.sonatype.com/artifact/com.mparticle/braze-40) |
| [Braze 41](kits/braze/braze-41) | [`com.mparticle:braze-41`](https://central.sonatype.com/artifact/com.mparticle/braze-41) |
| [CleverTap](kits/clevertap/clevertap-7) | [`com.mparticle:clevertap-7`](https://central.sonatype.com/artifact/com.mparticle/clevertap-7) |
| [comScore](kits/comscore/comscore-6) | [`com.mparticle:comscore-6`](https://central.sonatype.com/artifact/com.mparticle/comscore-6) |
| [Iterable](kits/iterable/iterable-3) | [`com.mparticle:iterable-3`](https://central.sonatype.com/artifact/com.mparticle/iterable-3) |
| [Kochava](kits/kochava/kochava-5) | [`com.mparticle:kochava-5`](https://central.sonatype.com/artifact/com.mparticle/kochava-5) |
| [Leanplum](kits/leanplum/leanplum-7) | [`com.mparticle:leanplum-7`](https://central.sonatype.com/artifact/com.mparticle/leanplum-7) |
| [Localytics](kits/localytics/localytics-6) | [`com.mparticle:localytics-6`](https://central.sonatype.com/artifact/com.mparticle/localytics-6) |
| [OneTrust](kits/onetrust/onetrust) | [`com.mparticle:onetrust`](https://central.sonatype.com/artifact/com.mparticle/onetrust) |
| [Optimizely](kits/optimizely/optimizely-3) | [`com.mparticle:optimizely-3`](https://central.sonatype.com/artifact/com.mparticle/optimizely-3) |
| [Radar](kits/radar/radar-3) | [`com.mparticle:radar-3`](https://central.sonatype.com/artifact/com.mparticle/radar-3) |
| [Rokt](kits/rokt/rokt) | [`com.mparticle:android-rokt-kit`](https://central.sonatype.com/artifact/com.mparticle/android-rokt-kit) |
| [Singular](kits/singular/singular-12) | [`com.mparticle:singular-12`](https://central.sonatype.com/artifact/com.mparticle/singular-12) |
| Kit | Maven artifact |
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [Adjust](kits/adjust/adjust-5) | [`com.mparticle:adjust-5`](https://central.sonatype.com/artifact/com.mparticle/adjust-5) |
| [Adobe](kits/adobe/adobe) | [`com.mparticle:adobe`](https://central.sonatype.com/artifact/com.mparticle/adobe) |
| [AppsFlyer](kits/appsflyer/appsflyer-6) | [`com.mparticle:appsflyer-6`](https://central.sonatype.com/artifact/com.mparticle/appsflyer-6) |
| [Apptentive](kits/apptentive/apptentive-6) | [`com.mparticle:apptentive-6`](https://central.sonatype.com/artifact/com.mparticle/apptentive-6) |
| [Apptimize](kits/apptimize/apptimize-3) | [`com.mparticle:apptimize-3`](https://central.sonatype.com/artifact/com.mparticle/apptimize-3) |
| [Branch Metrics](kits/branch/branch-5) | [`com.mparticle:branch-5`](https://central.sonatype.com/artifact/com.mparticle/branch-5) |
| [Braze 38](kits/braze/braze-38) | [`com.mparticle:braze-38`](https://central.sonatype.com/artifact/com.mparticle/braze-38) |
| [Braze 39](kits/braze/braze-39) | [`com.mparticle:braze-39`](https://central.sonatype.com/artifact/com.mparticle/braze-39) |
| [Braze 40](kits/braze/braze-40) | [`com.mparticle:braze-40`](https://central.sonatype.com/artifact/com.mparticle/braze-40) |
| [Braze 41](kits/braze/braze-41) | [`com.mparticle:braze-41`](https://central.sonatype.com/artifact/com.mparticle/braze-41) |
| [Braze 43](kits/braze/braze-43) | [`com.mparticle:braze-43`](https://central.sonatype.com/artifact/com.mparticle/braze-43) |
| [CleverTap](kits/clevertap/clevertap-7) | [`com.mparticle:clevertap-7`](https://central.sonatype.com/artifact/com.mparticle/clevertap-7) |
| [comScore](kits/comscore/comscore-6) | [`com.mparticle:comscore-6`](https://central.sonatype.com/artifact/com.mparticle/comscore-6) |
| [Google Analytics](kits/ga/ga-23) | [`com.mparticle:ga-23`](https://central.sonatype.com/artifact/com.mparticle/ga-23) |
| [Google Analytics 4](kits/ga4/ga4-23) | [`com.mparticle:ga4-23`](https://central.sonatype.com/artifact/com.mparticle/ga4-23) |
| [Iterable](kits/iterable/iterable-3) | [`com.mparticle:iterable-3`](https://central.sonatype.com/artifact/com.mparticle/iterable-3) |
| [Kochava](kits/kochava/kochava-5) | [`com.mparticle:kochava-5`](https://central.sonatype.com/artifact/com.mparticle/kochava-5) |
| [Leanplum](kits/leanplum/leanplum-7) | [`com.mparticle:leanplum-7`](https://central.sonatype.com/artifact/com.mparticle/leanplum-7) |
| [Localytics](kits/localytics/localytics-6) | [`com.mparticle:localytics-6`](https://central.sonatype.com/artifact/com.mparticle/localytics-6) |
| [OneTrust](kits/onetrust/onetrust) | [`com.mparticle:onetrust`](https://central.sonatype.com/artifact/com.mparticle/onetrust) |
| [Optimizely](kits/optimizely/optimizely-3) | [`com.mparticle:optimizely-3`](https://central.sonatype.com/artifact/com.mparticle/optimizely-3) |
| [Radar](kits/radar/radar-3) | [`com.mparticle:radar-3`](https://central.sonatype.com/artifact/com.mparticle/radar-3) |
| [Rokt](kits/rokt/rokt) | [`com.mparticle:android-rokt-kit`](https://central.sonatype.com/artifact/com.mparticle/android-rokt-kit) |
| [Singular](kits/singular/singular-12) | [`com.mparticle:singular-12`](https://central.sonatype.com/artifact/com.mparticle/singular-12) |
| [Urban Airship](kits/urbanairship/urbanairship-20) | [`com.mparticle:urbanairship-20`](https://central.sonatype.com/artifact/com.mparticle/urbanairship-20) |

### Google Play Services Ads

Expand Down
8 changes: 5 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use `Release - Draft` to prepare a release PR. The workflow:
1. Reads the current version from `VERSION`.
2. Computes the next release version from `bump-type` and optional `qualifier`.
3. Writes the computed version back to `VERSION`.
4. Publishes to Maven local as a smoke test.
4. Publishes core, aggregate kits, and isolated kits to Maven local as a smoke test.
5. Generates the changelog entry.
6. Opens a PR back into the branch selected in the workflow dispatch UI.

Expand All @@ -26,7 +26,7 @@ Generated release PR branches use `release/prep-<version>`, for example `release
- `main`
- `workstation/*`

The workflow publishes the SDK and kits to Maven Central using the exact version in `VERSION`, then creates a GitHub release with the same tag.
The workflow validates every publication in Maven local before publishing the SDK, aggregate kits, and isolated kits to Maven Central using the exact version in `VERSION`. It creates a GitHub release with the same tag only after every publication succeeds.

## Stable releases

Expand Down Expand Up @@ -70,7 +70,9 @@ After a successful publish workflow, verify:
1. The GitHub release exists with the expected tag.
2. The SDK artifact is present in [Sonatype](https://central.sonatype.com/publishing).
3. The kit artifacts are present in [Sonatype](https://central.sonatype.com/publishing).
4. Pre-release tags are marked as pre-releases and stable tags are marked as latest.
4. `urbanairship-20`, `braze-43`, `ga-23`, and `ga4-23` are present at the release version.
5. Every kit POM depends on `android-kit-base` at the exact release version.
6. Pre-release tags are marked as pre-releases and stable tags are marked as latest.

## Troubleshooting

Expand Down
2 changes: 0 additions & 2 deletions buildSrc/build.gradle.kts → build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ tasks.withType<KotlinCompile>().configureEach {
}

dependencies {
implementation("com.android.tools.build:gradle:8.3.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.31.0")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.tasks.PublishToMavenLocal
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.jvm.tasks.Jar

fun Project.configureMavenPublishing(mparticleMavenPublish: MParticleMavenPublishExtension) {
Expand Down Expand Up @@ -100,6 +101,12 @@ fun Project.configureMavenPublishing(mparticleMavenPublish: MParticleMavenPublis
dependsOn(validateTaskName)
}
}

tasks.withType(PublishToMavenRepository::class.java).configureEach {
if (name.contains(publicationName, ignoreCase = true)) {
dependsOn(validateTaskName)
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ buildscript {
}

plugins {
id "mparticle.android.library.publish" apply false
id "org.sonarqube" version "3.5.0.2730"
id "org.jlleitschuh.gradle.ktlint" version "13.0.0"
}
Expand Down
Loading
Loading