Skip to content

Move from bcv plugin to KGP api validation - #6362

Open
markushi wants to merge 1 commit into
mainfrom
build/kgp-abi-validation
Open

markushi wants to merge 1 commit into
mainfrom
build/kgp-abi-validation

Conversation

@markushi

@markushi markushi commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

📜 Description

The Binary Compatibility Validator plugin is in maintenance mode, and superseded by the built-in ABI validation feature of the Kotlin Gradle Plugin.

Luckily the resulting .api files stayed identical, so the diff is relatively easy.
Also deleted two stale .api files from sample apps along the way.

💡 Motivation and Context

Groundwork for Gradle Isolated Projects feature, which the Binary Compatibility Validator plugin does not support (see Kotlin/binary-compatibility-validator#298).

💚 How did you test it?

Manually, deleted all .api files, regenerated them.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

#skip-changelog

@sentry

sentry Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.1 (1) release

⚙️ sentry-android Build Distribution Settings

@markushi markushi added the sanity-check PR needs a lightweight review for obvious issues label Oct 23, 2026
@markushi
markushi force-pushed the build/kgp-abi-validation branch from f1d130d to 0d800c3 Compare October 23, 2026 09:50
@markushi
markushi changed the base branch from refactor/apply-plugins-per-module to main October 23, 2026 09:51

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great cleanup!

project.pluginManager.withPlugin(it) { enable(project, extension) }
}

// Aliases for backwards compat with the old binary-compatibility-validator plugin.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would remove the backwards compatibility here. having more than one way or doing something is confusing for humans and agents.

Comment thread build.gradle.kts
}
}

apiValidation {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where was this consumed? was it the root plugin alias(libs.plugins.binary.compatibility.validator) ?

val kotlin = project.extensions.getByName("kotlin") as ExtensionAware
val spec: AbiValidationVariantSpec =
when (val abi = kotlin.extensions.getByName("abiValidation")) {
is AbiValidationMultiplatformExtension -> abi.also { it.enabled.set(true) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sad we can't do this. i bet we could though if this was a .kts file. and just FYI you can write these convention plugins in kts

Suggested change
is AbiValidationMultiplatformExtension -> abi.also { it.enabled.set(true) }
is AbiValidationMultiplatformExtension -> abi.enabled.set(true) }

}
// Lazy, because the module configures the extension after this plugin has been applied.
val ignored = extension.ignoredPackages.map { packages -> packages.map { "$it.**" } }
spec.filters { exclude { byNames.addAll(ignored) } }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this up to line 48 like so?

filters { exclude { byNames.addAll(....) } }

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants