From 40dd76487ce02a34f7cd6e35581b89f95e81321c Mon Sep 17 00:00:00 2001 From: JakubMrozek Date: Sat, 23 May 2026 11:11:37 +0200 Subject: [PATCH] fix(publish): gate omsdk-android Maven Central publish behind -PpublishOmsdk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vanniktech bundles every module in one `publishToMavenCentral` invocation into a single Central Portal deployment. Since omsdk-android's coordinate (so.kontext.iab:omsdk-android:1.6.4) is immutable on Maven Central and its version is independent of KontextKit's semver, every normal release tried to re-upload it — the existing coordinate fails component validation and takes down the whole deployment (this blocked the 0.0.7 release). Disable the omsdk-android Central-publish tasks unless `-PpublishOmsdk=true`, so a normal release deployment carries only kontext-kit-android. Pass the flag only when actually bumping the bundled IAB AAR. Verified: `./gradlew :omsdk-android:publishToMavenCentral` skips all of its MavenCentral tasks (incl. the staging task) by default; the escape-hatch flag re-enables them. Co-Authored-By: Claude Opus 4.7 --- omsdk-android/build.gradle.kts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/omsdk-android/build.gradle.kts b/omsdk-android/build.gradle.kts index b7f8039..a8efe23 100644 --- a/omsdk-android/build.gradle.kts +++ b/omsdk-android/build.gradle.kts @@ -110,6 +110,25 @@ tasks.withType().configureEach { enabled = false } +// --- Maven Central publish gate ------------------------------------------- +// The IAB OMID AAR (1.6.4) is immutable on Maven Central once uploaded, and +// its version is independent of KontextKit's semver. Normal KontextKit +// releases must NOT re-upload it: the Central Portal rejects an +// already-existing coordinate and fails the *entire aggregated deployment* +// (vanniktech bundles every module in one Gradle invocation into a single +// deployment). That is exactly what broke the 0.0.7 release — the bundle +// paired the new `kontext-kit-android:0.0.7` with the already-published +// `omsdk-android:1.6.4`, so neither published. +// +// Publish this module only when the AAR itself changes, by passing +// `-PpublishOmsdk=true`. Otherwise its Maven Central upload tasks are +// disabled, so a normal release deployment carries only the main module. +val publishOmsdk = (project.findProperty("publishOmsdk") as String?) == "true" +if (!publishOmsdk) { + tasks.matching { it.name.contains("MavenCentral") } + .configureEach { enabled = false } +} + // Swap vanniktech's default jar artifact for the IAB AAR. `afterEvaluate` // because vanniktech registers its publication during `apply()` and we // need to mutate it after that registration completes.