natario1
09/18/2020, 4:53 PMX depends on project(":Y") and on some cinterop libraries. Because of how cinterop tasks are configured by the Kotlin plugin, anytime Y changes, all the interops are executed again, slowing down the build.Kris Wong
09/18/2020, 4:54 PMKris Wong
09/18/2020, 4:55 PMnatario1
09/18/2020, 5:00 PMilya.matveev
09/21/2020, 1:10 PMA -> B. We create a Kotlin wrapper for the B library and publish it (name this wrapper B-kt). Now we want to interop the A library and use it together with B-kt in an app. In this case cinterop bindings produced for A and B should be compatible. To achieve that, we pass a cinterop klib produced for B and published with B-kt to the cinterop tool, when we produce bindings for A.
In this case, if the cinterop tool find some `B`'s symbol in `A`'s API, it will not generate a new binding for it. Instead, it will use the already generated binding, so Kotlin APIs of A and B will be compatible.
But I agree that the Gradle plugin can be more smart here and don't consider non-cinterop klibs as inputs for cinterop tasks.
Add a link to your issue to this thread, just for the record: https://youtrack.jetbrains.com/issue/KT-42056natario1
09/21/2020, 1:21 PM