Open vRallev opened 8 months ago
@vRallev how exactly do you disable the second target for the CI? Or maybe you have a small reproducer already?
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.
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?
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
.
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
andapi/desktop
. However, in CI we disable the desktop target and only Android is present. TheapiCheck
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.