Expose cinterops declarations in Maven publication

If you add a cinterop to your K/N project and publish it on Maven, the klib generated by the cinterop is correctly published inside the publication, but the consumer of the publication has no access to the bindings.

Is it possible to make those stubs transitive?

I noticed that AtomicFU somewhere, somehow, published its cinterops and they are available when adding it to the dependencies.

Turns out you just need to publish the Gradle metadata artifact and it works out of the box. I was using the Bintray Gradle plugin to publish my library which skips the metadata artifact. There is an issue on their repo where a workaround has been found.

1 Like