Skip to content

Resource compiler tooling for Kotlin/Native with zlib compression support.

License

Notifications You must be signed in to change notification settings

karmakrafts/KMbed

Repository files navigation

KMbed

KMbed is a Gradle/KMP plugin for embedding resources in Kotlin/Native executables.
The runtime provides an API similar to Android's R-class, zlib compression and kotlinx.io integration.

How to use it

Using KMbed is as simple as applying the KMbed Gradle Plugin and the Kotlin/Native runtime.

plugins {
    id("io.karma.kmbed.kmbed-gradle-plugin") version "<version>"
}

kotlin {
    sourceSets {
        nativeMain {
            dependencies {
                implementation("io.karma.kmbed:kmbed-runtime:<version>")
            }
        }
    }
}

How to configure it

The following configuration properties are avaiable through the kmbed project extension:

kmbed {
    // Allows changing the namespace (package name) of the generated resources for the current module
    resourceNamespace = "com.example.foo"
    // Allows force-disabling resource compression in the resource compiler
    compression = false
    // Allows adjusting the threshold at which resources are compressed (in bytes)
    compressionThreshold = 256
}

About

Resource compiler tooling for Kotlin/Native with zlib compression support.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages