gradle

Kotlin WebAssembly WebGL Auto Stub

Submitted by Dickens A S on Sat, 05/02/2020 - 05:37

WebGLRenderingContext is a big API, it has 200+ properties and 100+ methods, writing a JavaScript stub and corresponding Kotlin stub is very difficult 

We need to write 1400+ lines of JavaScript code and 3000+ lines Kotlin code

This Kotlin gradle script provides a simple approach to auto generate the stub and also compile the generated code to .klib

Gradle Stub Code in KTS

Kickstart kotlin code and run in browser using CDN

Submitted by Dickens A S on Fri, 11/01/2019 - 13:57

Easily create kotlin project from these boilerplate Gradle DSL 
Run in browser without additional JS packaging scripts

the Kotlin dependency is added in browser using below CDN

<script src="https://cdn.jsdelivr.net/npm/kotlin@1.3.50/kotlin.js"></script>

Source code available in GitHub