A general-purpose multiplatform library. Implemented in Kotlin, usable also from Java, JavaScript/TypeScript and more.
Note however that due to the current nature of Kotlin Multiplatform, many parts of the library are not available from regular JavaScript/TypeScript projects.
There are Kotlin API docs for all platforms.
You can use this library with any language that runs on the Java Virtual Machine: Java, Kotlin, Scala etc.
The build artifacts have been published to the Maven Central Repository.
<dependency>
<groupId>com.marcoeckstein</groupId>
<artifactId>kotlin-lib-jvm</artifactId>
<version>${version}</version>
</dependency>
implementation("com.marcoeckstein:kotlin-lib:$version")
implementation 'com.marcoeckstein:kotlin-lib:$version'
Use the same snippets as for a Gradle JVM project (see above).
npm install --save @marco-eckstein/kotlin-lib@$version
import * as kotlinLib from "@marco-eckstein/kotlin-lib";
# Kotlin multiplatform exports full namespaces:
const klib = kotlinLib.com.marcoeckstein.klib
klib.kotlin.stringify(undefined)
I do not actively support this, but you should be able to build native binaries of this project yourself using Gradle. Please see the Kotlin Multiplatform docs.
gradlew build
These notes are primarily for myself.
gradlew publish -PsonatypeStagingPassword=<password>
This task will include these steps:
- Sign the artifacts
A prompt will ask for the password that encrypts the GnuPG key configured ingradle.properties
. - Publish the JavaScript package
build\packages\js\
to NPM
You need to be logged in to NPM. - Upload the Maven artifacts (
.jar
files etc.) to the staging repository at OSS Repository Hosting that belongs to the username configured ingradle.properties
.
These steps need to be performed manually:
- Login to OSS Repository Hosting
- Review the artifacts
- Close and Release the repository. This will publish the artifacts to the Maven Central Repository. Docs will appear automatically at javadoc.io.
More info at: https://central.sonatype.org/publish/