SWIG

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 JNI using SWIG Arrays and Pointers

Submitted by Dickens A S on Mon, 07/19/2021 - 09:28

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

This Article demonstrates how to pass pointers and arrays in and out using pure C code and JNI and force pure C code in Gradle

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

The Gradle SWIG Task of cpplib

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