Skip to content

kuzzleio/sdk-jvm

Repository files navigation

Kotlin SDK

Build Status

Official Kuzzle JVM SDK

About Kuzzle

A backend software, self-hostable and ready to use to power modern apps.

You can access the Kuzzle repository on Github

SDK Documentation

The complete SDK documentation is available here

Protocol used

The JVM SDK implements the websocket protocol and http protocol.

Build jar

Execute the following snippet to clone the GIT repository, and build the SDK. It will then be available in the "build/" directory

git clone [email protected]:kuzzleio/sdk-jvm.git
cd sdk-jvm
./gradlew jar

You can then find the jars file in build/libs/

Installation

Compatibility Matrix

SDK Version Ktor Version Gradle Version Java Version
< 1.3.0 1.5.2 6.1 JDK-8
>= 1.3.0 1.6.8 7.4 JDK-11
SDK Version Kuzzle Version
< 1.3.0 2.x.x
>= 1.3.0 Websocket: 2.x.x
HTTP: >=2.18.1

Maven

<dependency>
  <groupId>io.kuzzle</groupId>
  <artifactId>sdk-jvm</artifactId>
  <version>1.3.0</version>
  <type>pom</type>
</dependency>

Gradle

compile 'io.kuzzle:sdk-jvm:1.3.0'

For amd64:

compile 'io.kuzzle:sdk-jvm:1.3.0'

Ivy

<dependency org='io.kuzzle' name='sdk-jvm' rev='1.3.0'>
  <artifact name='sdk-jvm' ext='pom' ></artifact>
</dependency>

This SDK has 2 jar files that you can use:

  • sdk-jvm-<version>.jar: this is the fat jar version, containing the SDK and all its dependencies.
  • sdk-jvm-<version>-without-dependencies.jar: this is the thin jar version of the SDK, without any dependencies included in it.

Depending on your project, you might need one or the other version of the SDK: if you already use some of the dependencies needed by the SDK, then you need to use the thin jar version. Otherwise, you may use the fat jar one.

⚠️ Warning If you are using the fat jar, you might have duplicate dependencies issues in a Kotlin Android Studio project. Add the following lines to your build.gradle file:

configurations {
     cleanedAnnotations
     compile.exclude group: 'org.jetbrains'
     compile.exclude group: 'org.jetbrains.kotlin'
 }

If you are using the thin jar, make sure to add the following dependencies:

    implementation("io.ktor:ktor-client-core:1.6.8")
    implementation("io.ktor:ktor-client-websockets:1.6.8")
    implementation("io.ktor:ktor-client-okhttp:1.6.8")
    implementation("io.ktor:ktor-client-cio:1.6.8")
    implementation("io.ktor:ktor-client-json:1.6.8")
    implementation("io.ktor:ktor-client-gson:1.6.8")
    implementation("io.ktor:ktor-client-serialization:1.6.8")
    implementation("com.google.code.gson:gson:2.9.0")