Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to always generate platform specific folders #174

Open
vRallev opened this issue Jan 24, 2024 · 4 comments
Open

Add option to always generate platform specific folders #174

vRallev opened this issue Jan 24, 2024 · 4 comments
Labels

Comments

@vRallev
Copy link

vRallev commented Jan 24, 2024

In our Kotlin Multiplatform project we use two JVM targets (Android and desktop), therefore this plugin will use two different folders for the API dumps: api/android and api/desktop. However, in CI we disable the desktop target and only Android is present. The apiCheck then will fail, because it doesn't look in the right directory for the dump. The code is here.

To avoid the issue, either an option to always us the platform specific folder no matter how many JVM targets would work, or as an alternative an option to disable targets, e.g. we'd disable desktop and only use Android.

@fzhinkin
Copy link
Collaborator

@vRallev how exactly do you disable the second target for the CI? Or maybe you have a small reproducer already?

@vRallev
Copy link
Author

vRallev commented Jan 24, 2024

I've attached a sample project. To disable a target I simply don't configure it. The sample has a flag in build.gradle.kts:

val desktopEnabled = false

Depending on this flag the apiCheck will fail or be successful.

KotlinProject.zip

@fzhinkin
Copy link
Collaborator

Thanks for the reproducer!

To avoid the issue, either an option to always us the platform specific folder no matter how many JVM targets would work, or as an alternative an option to disable targets, e.g. we'd disable desktop and only use Android.

Just to explore possible solutions: would an option to use flat dump files layout (like api/<moduleName>.android.api, api/<moduleName>.desktop.api) work for you?

@vRallev
Copy link
Author

vRallev commented Jan 24, 2024

Yes, it would. The important piece here is that the output path and file name must stay consistent and not depend on how many JVM targets are there, so it shouldn't switch between <moduleName>.android.api and <moduleName>.api.

@fzhinkin fzhinkin added the gradle label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants