Kotlin JVM JNI C++ Inheritance and Callback using SWIG

Submitted by Dickens A S on Tue, 07/20/2021 - 03:59

Based on Article kotlin-jni-swig-gradle-cpp

This Article demonstrates how to Inherit class from C++ class and how to make C++ calls back the Kolin function using overriding

GitHub: https://github.com/dickensas/kotlin-gradle-templates/tree/master/swig-jni-inherit-callback

For C Pointer Refer Article kotlin-swig-jni-arrays-and-pointers

Kotlin JVM Easy JNI using SWIG and Gradle CPP

Submitted by Dickens A S on Sat, 08/22/2020 - 15:34

This article demonstrates easy way of generating C++ stub code including Java Generation for the corresponding C++ Classes using SWIG

The Gradle KTS project contains a sub module which contains the main source code, the header file and the SWIG file

The Gradle KTS is written in such way it will call the "swig" command line and generates the wrappers and copies the files to corresponding locations

The C++ compiler is auto chosen by Gradle cpp-library plugin, there is no need to write CMake or MakeFile or batch files for that