Kotlin 1.2.* multi-platform experiments
- Shared/multiplatform code
- ./src
- JS-specific code
- ./src-js
- Java-specific code
- ./src-jvm
- Typescript code (consumes the JS-specific code's output)
- ./ts
- Final Kotlin build output
- ./build
- Final JS module build output (importable as module)
- ./src-js/build
- Final Java module build output - importable as module (NOTE: confirm this)
- ./src-jvm/build/libs/src-jvm.jar
- Final TS module build output (runnable)
- ./build-js/src-js/build/js/index.js
Install modules:
yarn
Perform your initial build:
npm run start
npm run start
...OR:
npm run buildrun-full
./gradlew build
...OR:
npm run build-kotlin
npm run build-typescript
npm run run-js
npm run watch-buildrun-full
==================================================
// Multiplatform library/module written in Kotlin \\
||===================================================================
|| [./src] [./src-js] ||
|| Common code ------------shared with------------> Kotlin-JS code ||
|| ||
|| [./src-jvm] [./src] ||
|| Kotlin-Java code --implements requirements of--> Common code ||
|| ||
|| [./src-js] [./src] ||
|| Kotlin-JS code ---implements requirements- of--> Common code ||
=====================================================================
/\ /\
|| ||
[consumes/imports] [consumes/imports]
|| ||
============= ================================
|| [./ts] || || [./java] (not implemented) ||
|| TS code || || Runnable Java code ||
============= ================================ [1]
|| ||
[transpiles to] \/
|| Displays output
\/
=========================
|| [./src-js/build/js] ||
|| Runnable JS code ||
=========================
||
\/
Displays output
-------------JS------------- ---------------Java---------------
[1] Different code from the Kotlin-Java code mentioned in the multiplatform
library/module block at the top of the diagram