copyToResources

abstract fun copyToResources(resourceDir: String = "natives/")

Packages this target's binary into the resources of the consumer compilation, so that the JVM code can load it from the classpath. On Android the binary goes into the assets of the variant instead.

Only the targets this is called for are packaged; the rest of the library's targets are left out.

Parameters

resourceDir

path to package the binary at, relative to the resources root (or to the Android assets root). The default is what the target's own os and arch imply:

// the linux-x86_64 binary of the `native` library
getResourceAsStream("/natives/linux-x86_64/libnative.so")