{"id":25430459,"url":"https://github.com/karmakrafts/kmbed","last_synced_at":"2025-10-31T20:30:21.613Z","repository":{"id":276541590,"uuid":"921634852","full_name":"karmakrafts/KMbed","owner":"karmakrafts","description":"Resource compiler tooling for Kotlin Multiplatform.","archived":false,"fork":false,"pushed_at":"2025-02-16T00:55:49.000Z","size":226,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T01:25:23.833Z","etag":null,"topics":["api","embedding","gradle","gradle-plugin","kotlin","kotlin-js","kotlin-jvm","kotlin-multiplatform","kotlin-native","kotlinx-io","library","plugin","resources"],"latest_commit_sha":null,"homepage":"https://git.karmakrafts.dev/kk/kmbed","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karmakrafts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-24T10:18:15.000Z","updated_at":"2025-02-16T00:55:53.000Z","dependencies_parsed_at":"2025-02-08T22:37:29.099Z","dependency_job_id":null,"html_url":"https://github.com/karmakrafts/KMbed","commit_stats":null,"previous_names":["karmakrafts/kmbed"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2FKMbed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2FKMbed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2FKMbed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2FKMbed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karmakrafts","download_url":"https://codeload.github.com/karmakrafts/KMbed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239228817,"owners_count":19603709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","embedding","gradle","gradle-plugin","kotlin","kotlin-js","kotlin-jvm","kotlin-multiplatform","kotlin-native","kotlinx-io","library","plugin","resources"],"created_at":"2025-02-17T03:28:37.931Z","updated_at":"2025-10-31T20:30:21.264Z","avatar_url":"https://github.com/karmakrafts.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KMbed\n[![](https://git.karmakrafts.dev/kk/kmbed/badges/master/pipeline.svg)](https://git.karmakrafts.dev/kk/kmbed/-/pipelines)\n[![](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Ffiles.karmakrafts.dev%2Fmaven%2Fio%2Fkarma%2Fkmbed%2Fkmbed-runtime%2Fmaven-metadata.xml)](https://git.karmakrafts.dev/kk/kmbed/-/packages)\n\nKMbed is a Gradle/KMP plugin for embedding resources in KMP modules.  \nThe runtime provides an API similar to Android's R-class, zlib compression and [kotlinx.io](https://github.com/Kotlin/kotlinx-io) integration.\n\n### Platform support\n\n* Windows x64\n* Linux x64\n* Linux arm64\n* macOS x64\n* macOS arm64\n* iOS x64\n* iOS arm64\n* Android Native x64\n* Android Native arm64\n* Android Native arm32\n* JVM\n* JS\n\n### How to use it\n\nFirst, add the required maven repository:\n\n```kotlin\nrepositories {\n    maven(\"https://files.karmakrafts.dev/maven\")\n}\n```\n\nUsing KMbed is as simple as applying the KMbed Gradle Plugin and the runtime.\n\n```kotlin\nplugins {\n    id(\"io.karma.kmbed.kmbed-gradle-plugin\") version \"\u003cversion\u003e\"\n}\n\nkotlin {\n    sourceSets {\n        commonMain {\n            dependencies {\n                implementation(\"io.karma.kmbed:kmbed-runtime:\u003cversion\u003e\")\n            }\n        }\n    }\n}\n```\n\nResource may be accessed from any source set using the `Res` global:\n\n```kotlin\nimport com.example.foo.Res // Generated resource index\n\nfun main(args: Array\u003cString\u003e) {\n    val data = Res[\"my_resource.bin\"].asByteArray()\n    // ...\n}\n```\n\n### How to configure it\n\nThe following configuration properties are avaiable through the kmbed project extension:\n\n```kotlin\nkmbed {\n    // Allows changing the namespace (package name) of the generated resources for the current module\n    resourceNamespace = \"com.example.foo\"\n    // Allows force-disabling resource compression in the resource compiler\n    compression = true\n    // Allows adjusting the threshold at which resources are compressed (in bytes)\n    compressionThreshold = 256\n    // Custom source sets\n    kmbedSourceSets {\n        defaultSourceSets(project)\n        val customSourceSet by creating {\n            resourceNamespace = \"com.example.foo.bar\"\n            compression = false\n        }\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarmakrafts%2Fkmbed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarmakrafts%2Fkmbed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarmakrafts%2Fkmbed/lists"}