Skip to content

A general-purpose multiplatform library. Implemented in Kotlin, usable also from Java, JavaScript and more.

License

Notifications You must be signed in to change notification settings

marco-eckstein/kotlin-lib

Repository files navigation

kotlin-lib

Actions Status

Maven Central Status javadoc

npm version npm downloads

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.

Usage with JVM

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.

Maven

<dependency>
    <groupId>com.marcoeckstein</groupId>
    <artifactId>kotlin-lib-jvm</artifactId>
    <version>${version}</version>
</dependency>

Gradle (Kotlin DSL)

implementation("com.marcoeckstein:kotlin-lib:$version")

Gradle (Groovy DSL)

implementation 'com.marcoeckstein:kotlin-lib:$version'

Usage with Kotlin Multiplatform

Use the same snippets as for a Gradle JVM project (see above).

Usage with JavaScript/TypeScript

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)

Usage with C, Objective-C etc.

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.

Development

Build locally

gradlew build

Publish

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 in gradle.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 in gradle.properties.

These steps need to be performed manually:

More info at: https://central.sonatype.org/publish/

About

A general-purpose multiplatform library. Implemented in Kotlin, usable also from Java, JavaScript and more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published