Skip to content

Build: Migrate BCV and run checks for PRs#35

Closed
Goooler wants to merge 2 commits into
zhanghai:masterfrom
Goooler:migrate-bcv
Closed

Build: Migrate BCV and run checks for PRs#35
Goooler wants to merge 2 commits into
zhanghai:masterfrom
Goooler:migrate-bcv

Conversation

@Goooler
Copy link
Copy Markdown
Contributor

@Goooler Goooler commented May 28, 2026

It helps us avoid accidental API breaking changes.

https://kotlinlang.org/docs/gradle-binary-compatibility-validation.html

  • Tests pass
  • Appropriate changes to README are included in PR

@zhanghai
Copy link
Copy Markdown
Owner

BCV in KGP is still experimental, so I'd like to wait for it to be stable before migration. (Or once AndroidX migrates.)

I was under the impression apiCheck should be part of assembleDebug or lintVitalRelease - is that not the case? If not, I'd like to add apiCheck on root project instead of only on the preference project.

@Goooler
Copy link
Copy Markdown
Contributor Author

Goooler commented May 29, 2026

apiCheck doesn't matter to assemble or lint stuff. It has been added to check task lifecycle.

@Goooler Goooler mentioned this pull request May 29, 2026
2 tasks
@Goooler
Copy link
Copy Markdown
Contributor Author

Goooler commented May 29, 2026

Addressing 8024e7c to #36.

@zhanghai
Copy link
Copy Markdown
Owner

https://github.com/kotlin/binary-compatibility-validator#tasks :

apiCheck — builds the project and checks that project's public API is the same as golden value in project api subfolder. This task is automatically inserted into check pipeline, so both build and check tasks will start checking public API upon their execution.

You are right it's only in check (and thus build).

I was using assembleDebug lintVitalRelease as a workaround to bypass release build which requires signing but still run the release lint. I think given that we want apiCheck, we should just switch to buildDebug lintVitalRelease. Wdyt?

@Goooler
Copy link
Copy Markdown
Contributor Author

Goooler commented May 29, 2026

Actually I prefer running build as the only job, which contains the most lifecycle tasks.

I was using assembleDebug lintVitalRelease as a workaround to bypass release build

We can add signingConfig signingConfigs.debug for the release variant to fix it. e.g.

@zhanghai
Copy link
Copy Markdown
Owner

I think that doesn't really work when I actually want to publish the sample app. So I'd still prefer a solution that works universally, and seems to me that would be buildDebug lintVitalRelease.

@Goooler
Copy link
Copy Markdown
Contributor Author

Goooler commented May 31, 2026

Debug signings are created by AGP, and they can be reused for release builds. The only side effect is that the debug signings are not permanent across different CI runners.

If we need the permanent signing, try something like creating storable credentials for this project or decoding the personal credentials on CI. However, I don't think it's worth for investing so much engineering effort into such a sample project.

@zhanghai
Copy link
Copy Markdown
Owner

I don't really want to reuse my debug signing for release builds - but I don't want to create stored credentials (or using CI secrets) in the git repo either. So I'd rather keep using buildDebug and lintVitalRelease.

@zhanghai zhanghai closed this May 31, 2026
@Goooler
Copy link
Copy Markdown
Contributor Author

Goooler commented Jun 1, 2026

apiCheck is not included by buildDebug.

See https://github.com/zhanghai/ComposePreference/actions/runs/26722413641/job/78751771933

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants