diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 39bce3005..97e8428bc 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -245,6 +245,9 @@ jobs: run: ./gradlew publishReleaseLocal - name: "Run Android Kit Lint" run: ./gradlew publishReleaseLocal -c settings-kits.gradle lint + - name: "Run Isolated Kit Lint (urbanairship-kit)" + working-directory: kits/urbanairship-kit + run: ./gradlew lint - name: "Archive Test Results" uses: actions/upload-artifact@v6 if: always() @@ -281,6 +284,9 @@ jobs: run: ./gradlew publishReleaseLocal - name: "Run Android Kit Kotlin Lint" run: ./gradlew publishReleaseLocal -c settings-kits.gradle ktlintCheck + - name: "Run Isolated Kit Kotlin Lint (urbanairship-kit)" + working-directory: kits/urbanairship-kit + run: ./gradlew ktlintCheck - name: "Archive Test Results" uses: actions/upload-artifact@v6 if: always() @@ -320,6 +326,9 @@ jobs: run: ./gradlew -PisRelease=true clean publishReleaseLocal - name: "Test Kits" run: ./gradlew -PisRelease=true clean testRelease publishReleaseLocal -c settings-kits.gradle + - name: "Test Isolated Kits (urbanairship-kit)" + working-directory: kits/urbanairship-kit + run: ./gradlew -PisRelease=true clean testRelease publishReleaseLocal semantic-release-dryrun: name: "Test Semantic Release - Dry Run" diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5a2e6f710..e3f87f6ed 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -254,6 +254,9 @@ jobs: run: ./gradlew -PisRelease=true :android-kit-base:testRelease - name: "Run Kit Release Tests and Build" run: ./gradlew -PisRelease=true -p kits testRelease -c ../settings-kits.gradle + - name: "Run Isolated Kit Compatibility Tests (urbanairship-kit)" + working-directory: kits/urbanairship-kit + run: ./gradlew -PisRelease=true testRelease automerge-dependabot: name: "Save PR Number for Dependabot Automerge" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af63fd22b..168b637f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,6 +151,14 @@ jobs: run: | ./gradlew -PisRelease=true publishReleasePublicationToMavenLocal ./gradlew -PisRelease=true publishReleasePublicationToMavenRepository -c settings-kits.gradle --stacktrace + - name: "Get SDK version for isolated kits" + if: ${{ github.event.inputs.dryRun == 'false'}} + id: sdk-version + run: echo "version=$(grep "version = " build.gradle | head -1 | sed "s/.*'\(.*\)-SNAPSHOT'/\1/")" >> $GITHUB_OUTPUT + - name: "Publish Isolated Kits (urbanairship-kit)" + if: ${{ github.event.inputs.dryRun == 'false'}} + working-directory: kits/urbanairship-kit + run: ./gradlew -PisRelease=true -Pversion=${{ steps.sdk-version.outputs.version }} publishReleasePublicationToMavenRepository --stacktrace # Temporary workaround: https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#ensuring-deployment-visibility-in-the-central-publisher-portal - name: Ensuring Deployment Visibility In The Central Publisher Portal diff --git a/AGENTS.md b/AGENTS.md index d0e807c40..7f2d41a40 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,6 +45,7 @@ You are a senior Android SDK engineer specializing in customer data platform (CD - Run unit tests: `./gradlew test` - Lint: `trunk check` (primary), `./gradlew ktlintCheck`, `./gradlew lint` - Instrumented tests: `./gradlew connectedAndroidTest` (requires emulator, API 28) + - Isolated kit tests: `cd kits/urbanairship-kit && ./gradlew testRelease` (for kits excluded from `settings-kits.gradle` due to Kotlin version) - Always validate changes with the full sequence in "Code style, quality, and validation" below before proposing or committing. ## Strict Do's and Don'ts @@ -103,6 +104,7 @@ You are a senior Android SDK engineer specializing in customer data platform (CD - `android-core/consumer-proguard.pro` — Consumer ProGuard rules. - `CHANGELOG.md` — Release notes (extensive). - `RELEASE.md` — Release process documentation. +- `settings-kits.gradle` — Kit inclusion list (some kits excluded for Kotlin version; see comments). - `CONTRIBUTING.md` — Contribution guidelines. - `ONBOARDING.md` — Onboarding guide. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa8dd5b54..075b2a8aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,6 +77,17 @@ We use JUnit and Mockito for our testing framework. Please write tests for new c Make sure all tests pass successfully before submitting your PR. If you encounter any test failures, investigate and fix the issues before proceeding. +#### Isolated Kit Tests + +Some kits require a different Kotlin version and are built standalone. +See [ONBOARDING.md](ONBOARDING.md#isolated-kits-different-kotlin-version) +for details. Before submitting a PR that affects core APIs, verify isolated +kits also build: + +```bash +cd kits/urbanairship-kit && ./gradlew testRelease +``` + ### Reporting Bugs This section guides you through submitting a bug report for the mParticle Android SDK. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. diff --git a/ONBOARDING.md b/ONBOARDING.md index 8c265ded7..4ac427a6f 100644 --- a/ONBOARDING.md +++ b/ONBOARDING.md @@ -139,6 +139,40 @@ Now run the following command in the terminal: You can now work on the specific kits you need, test them and even contribute through pull requests. +### Isolated Kits (different Kotlin version) + +Some kits require a higher Kotlin version than the main SDK and cannot be +included in the multi-kit `settings-kits.gradle` build. These kits are built +standalone from their own directory, using their own Gradle wrapper and +Kotlin version. + +**Currently isolated:** + +- `urbanairship-kit` (Kotlin 2.2.x, `urbanairship-core:20.3.0`) + +To build an isolated kit after publishing core to mavenLocal: + +```bash +cd kits/urbanairship-kit +./gradlew testRelease publishReleaseLocal +``` + +The kit resolves `android-kit-base` from mavenLocal, so you must publish +the core first (`./gradlew -PisRelease=true publishReleaseLocal`). + +To verify all kits (main + isolated): + +```bash +./gradlew -PisRelease=true publishReleaseLocal +./gradlew -PisRelease=true testRelease publishReleaseLocal -c settings-kits.gradle +cd kits/urbanairship-kit && ./gradlew -PisRelease=true testRelease +``` + +**Adding a new isolated kit:** If a kit upgrades to a Kotlin version +incompatible with the root KGP (2.0.20), remove it from +`settings-kits.gradle` with a comment, and add standalone build steps +to the CI workflows following the urbanairship-kit pattern. + ## Read More - [Official Oracle JDK download Website](https://www.oracle.com/java/technologies/downloads/) diff --git a/settings-kits.gradle b/settings-kits.gradle index 5a27af3da..5ace41a07 100644 --- a/settings-kits.gradle +++ b/settings-kits.gradle @@ -35,7 +35,7 @@ include ( //Swrve hosts kit ':kits:taplytics-kit', ':kits:tune-kit', - ':kits:urbanairship-kit', + // ':kits:urbanairship-kit', // Kotlin 2.2.x -- built standalone (see ONBOARDING.md) ':kits:wootric-kit', ':kits:example-kit' )