{"id":13992229,"url":"https://github.com/handstandsam/kmp-ready","last_synced_at":"2025-04-05T04:31:22.821Z","repository":{"id":58755399,"uuid":"527565486","full_name":"handstandsam/kmp-ready","owner":"handstandsam","description":"KMP Ready is a Gradle Plugin that provides actionable advice to make your code Kotlin Multiplatform compatible.","archived":false,"fork":false,"pushed_at":"2022-09-07T03:19:03.000Z","size":157,"stargazers_count":62,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T22:22:54.564Z","etag":null,"topics":["android","gradle","gradle-plugin","java","jvm","kotlin"],"latest_commit_sha":null,"homepage":"","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/handstandsam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-22T12:57:58.000Z","updated_at":"2024-12-28T06:14:20.000Z","dependencies_parsed_at":"2023-01-17T22:30:23.925Z","dependency_job_id":null,"html_url":"https://github.com/handstandsam/kmp-ready","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handstandsam%2Fkmp-ready","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handstandsam%2Fkmp-ready/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handstandsam%2Fkmp-ready/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handstandsam%2Fkmp-ready/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/handstandsam","download_url":"https://codeload.github.com/handstandsam/kmp-ready/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289382,"owners_count":20914463,"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":["android","gradle","gradle-plugin","java","jvm","kotlin"],"created_at":"2024-08-09T14:01:53.385Z","updated_at":"2025-04-05T04:31:17.806Z","avatar_url":"https://github.com/handstandsam.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# KMP Ready IS 🚧 UNDER DEVELOPMENT 🚧\n[![LICENSE](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/handstandsam/kmp-ready/blob/main/LICENSE)\n[![Latest Snapshot](https://img.shields.io/badge/dynamic/xml?url=https://s01.oss.sonatype.org/content/repositories/snapshots/com/handstandsam/kmp-ready/kmp-ready/maven-metadata.xml\u0026label=Latest%20Snapshot\u0026color=orange\u0026query=.//versioning/latest)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/handstandsam/kmp-ready/com.handstandsam.kmp-ready.gradle.plugin/)\n[![CI](https://github.com/handstandsam/kmp-ready/workflows/CI/badge.svg)](https://github.com/handstandsam/kmp-ready/actions?query=branch%3Amain)\n\n\n# Decisioning Logic\n## Positive Signals ✅\n### Only Kotlin `.kt` Source Files\n### Using Kotlin JVM Plugin\n### Uses the Kotlin Multiplatform Plugin\n* NOTE: We could check the configuration in the future to see if it has multiple targets if deemed important.\n\n## Negative Signals ❌\n### Are there any java imports in the source files?\nImports starting with `java.`, etc.\n* Iterate through all `main` sourcesets for a simple `.contains(\"import java.\")` List of all java stdlib packages: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/module-summary.html\n* NOTE: This wouldn't find fully qualified references, but that could be added later if deemed important.\n### Any non-multiplatform dependencies?\nSearch for transitive artifacts that are not multiplatform compatible\n* Use a list of well known libraries that are known to be multiplatform compatible, but then using the Maven Search API to look for the presence of the `kotlin-tooling-metadata.json` object via their JSON API at https://search.maven.org/.\n  * Example request for `ktor-client-core`: https://search.maven.org/solrsearch/select?q=g%3Aio.ktor+AND+a%3Aktor-client-core+AND+v%3A2.1.0+AND+p%3Ajar+AND+l%3Akotlin-tooling-metadata\u0026rows=1\u0026wt=json\n* NOTE: These results would be cached, the same way dependencies are today.\n* NOTE: We could traverse local module dependencies, and check theirs as well if deemed important.  \n### Is this an Android Library Module?\nThis tool works on `kotlin(\"jvm\")` modules.  If you are looking to move Android Libraries to Kotlin Multiplatform, the [dependency-analysis-android-gradle-plugin](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin) will help give you advice on which modules can become `kotlin(\"jvm\")` modules.  After that, come back and use `kmp-ready`.\n\n\n# `kmpReady` Gradle Task\nCould be applied to a specific module or the root so that all modules are scanned.\n\nRun the `kmpReady` task and get a result like this:\n```\n┌─────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐\n│ Module                          │ KMP Ready Result                                                                                                      │\n├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ :samples:android_app            │ Not KMP Ready                                                                                                         │\n│                                 │ ---                                                                                                                   │\n│                                 │ ✅ HasOnlyMultiplatformCompatibleDependencies                                                                          │\n│                                 │ ✅ HasOnlyKotlinFiles                                                                                                  │\n│                                 │ ❌ IsAndroidApplication                                                                                                │\n│                                 │ ❌ DoesNotHaveKotlinJvmOrMultiplatformPlugin                                                                           │\n│                                 │ Applied Plugins                                                                                                       │\n│                                 │  * com.android.build.gradle.AppPlugin                                                                                 │\n│                                 │  * com.android.build.gradle.api.AndroidBasePlugin                                                                     │\n│                                 │  * com.android.build.gradle.internal.plugins.AppPlugin                                                                │\n│                                 │  * com.android.build.gradle.internal.plugins.VersionCheckPlugin                                                       │\n│                                 │  * com.dropbox.gradle.plugins.dependencyguard.DependencyGuardPlugin                                                   │\n│                                 │  * org.gradle.kotlin.dsl.provider.plugins.KotlinScriptBasePlugin                                                      │\n│                                 │                                                                                                                       │\n│                                 │                                                                                                                       │\n├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ :samples:android_lib            │ Not KMP Ready                                                                                                         │\n│                                 │ ---                                                                                                                   │\n│                                 │ ✅ HasOnlyMultiplatformCompatibleDependencies                                                                          │\n│                                 │ ✅ HasOnlyKotlinFiles                                                                                                  │\n│                                 │ ❌ IsAndroidLibrary                                                                                                    │\n│                                 │ ❌ UsesJavaBaseImports                                                                                                 │\n│                                 │ Java Base Library Usages                                                                                              │\n│                                 │  * import java.util.Date                                                                                              │\n│                                 │    /Users/samedwards/src/kmp-readiness/samples/android_lib/src/main/java/kmp4free/samples/android.lib/AndroidLib.kt:3 │\n│                                 │ ❌ DoesNotHaveKotlinJvmOrMultiplatformPlugin                                                                           │\n│                                 │ Applied Plugins                                                                                                       │\n│                                 │  * com.android.build.gradle.LibraryPlugin                                                                             │\n│                                 │  * com.android.build.gradle.api.AndroidBasePlugin                                                                     │\n│                                 │  * com.android.build.gradle.internal.plugins.LibraryPlugin                                                            │\n│                                 │  * com.android.build.gradle.internal.plugins.VersionCheckPlugin                                                       │\n│                                 │  * org.gradle.kotlin.dsl.provider.plugins.KotlinScriptBasePlugin                                                      │\n│                                 │  * org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper                                                      │\n│                                 │                                                                                                                       │\n│                                 │                                                                                                                       │\n├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ :samples:jvm                    │ Not KMP Ready                                                                                                         │\n│                                 │ ---                                                                                                                   │\n│                                 │ ✅ HasOnlyKotlinFiles                                                                                                  │\n│                                 │ ✅ KotlinPluginEnabled                                                                                                 │\n│                                 │ ❌ IncompatibleDependencies                                                                                            │\n│                                 │ * com.squareup.okhttp3:okhttp:4.9.3                                                                                   │\n│                                 │ ❌ UsesJavaBaseImports                                                                                                 │\n│                                 │ Java Base Library Usages                                                                                              │\n│                                 │  * import java.util.Arrays                                                                                            │\n│                                 │    /Users/samedwards/src/kmp-readiness/samples/jvm/src/main/java/kmp4free/samples/JvmLib.kt:3                         │\n│                                 │  * val instant: java.time.Instant? = null                                                                             │\n│                                 │    /Users/samedwards/src/kmp-readiness/samples/jvm/src/main/java/kmp4free/samples/JvmLib.kt:9                         │\n│                                 │                                                                                                                       │\n│                                 │                                                                                                                       │\n├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ :samples:jvm_kmp4free           │ Not KMP Ready                                                                                                         │\n│                                 │ ---                                                                                                                   │\n│                                 │ ✅ HasOnlyMultiplatformCompatibleDependencies                                                                          │\n│                                 │ ✅ KotlinPluginEnabled                                                                                                 │\n│                                 │ ❌ HasJavaFiles                                                                                                        │\n│                                 │  * /Users/samedwards/src/kmp-readiness/samples/jvm_kmp4free/src/main/java/kmp4free/samples/ThisIsAJavaClass.java      │\n│                                 │                                                                                                                       │\n│                                 │                                                                                                                       │\n├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ :samples:multiplatform          │ KMP Ready                                                                                                             │\n│                                 │ ---                                                                                                                   │\n│                                 │ ✅ HasOnlyMultiplatformCompatibleDependencies                                                                          │\n│                                 │ ✅ HasOnlyKotlinFiles                                                                                                  │\n│                                 │ ✅ MultiplatformPluginAlreadyEnabled                                                                                   │\n│                                 │                                                                                                                       │\n│                                 │                                                                                                                       │\n├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n│ :samples:multiplatform_kmp4free │ KMP Ready                                                                                                             │\n│                                 │ ---                                                                                                                   │\n│                                 │ ✅ HasOnlyMultiplatformCompatibleDependencies                                                                          │\n│                                 │ ✅ HasOnlyKotlinFiles                                                                                                  │\n│                                 │ ✅ KotlinPluginEnabled                                                                                                 │\n│                                 │                                                                                                                       │\n│                                 │                                                                                                                       │\n└─────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n```\n\n## Info/Debug Logging\nJust pass use the info flag like `./gradlew kmpReady --info` when you run the Gradle task and all the information collected that is used for decisioning is printed.  Warning: This can be a TON of info on a large project.\n\n\n## Plugin Installation\nAdd the Snapshot Repo in your project's `settings.gradle.kts`\n```kotlin\npluginManagement {\n    repositories {\n        // ...\n        maven { url = \"https://s01.oss.sonatype.org/content/repositories/snapshots/\" }\n    }\n}\n```\n\nAdd the Plugin on your project's `build.gradle`\n```kotlin\nplugins {\n    id(\"com.handstandsam.kmp-ready\") version \"0.1.0-SNAPSHOT\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandstandsam%2Fkmp-ready","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhandstandsam%2Fkmp-ready","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandstandsam%2Fkmp-ready/lists"}