š§
UNDER DEVELOPMENT
š§
KMP Ready IS
Decisioning Logic
ā
Positive Signals .kt
Source Files
Only Kotlin Using Kotlin JVM Plugin
Uses the Kotlin Multiplatform Plugin
- NOTE: We could check the configuration in the future to see if it has multiple targets if deemed important.
ā
Negative Signals Are there any java imports in the source files?
Imports starting with java.
, etc.
- 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 - NOTE: This wouldn't find fully qualified references, but that could be added later if deemed important.
Any non-multiplatform dependencies?
Search for transitive artifacts that are not multiplatform compatible
- 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/. - NOTE: These results would be cached, the same way dependencies are today.
- NOTE: We could traverse local module dependencies, and check theirs as well if deemed important.
Is this an Android Library Module?
This tool works on kotlin("jvm")
modules. If you are looking to move Android Libraries to Kotlin Multiplatform, the 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
.
kmpReady
Gradle Task
Could be applied to a specific module or the root so that all modules are scanned.
Run the kmpReady
task and get a result like this:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Module ā KMP Ready Result ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā :samples:android_app ā Not KMP Ready ā
ā ā --- ā
ā ā ā
HasOnlyMultiplatformCompatibleDependencies ā
ā ā ā
HasOnlyKotlinFiles ā
ā ā ā IsAndroidApplication ā
ā ā ā DoesNotHaveKotlinJvmOrMultiplatformPlugin ā
ā ā Applied Plugins ā
ā ā * com.android.build.gradle.AppPlugin ā
ā ā * com.android.build.gradle.api.AndroidBasePlugin ā
ā ā * com.android.build.gradle.internal.plugins.AppPlugin ā
ā ā * com.android.build.gradle.internal.plugins.VersionCheckPlugin ā
ā ā * com.dropbox.gradle.plugins.dependencyguard.DependencyGuardPlugin ā
ā ā * org.gradle.kotlin.dsl.provider.plugins.KotlinScriptBasePlugin ā
ā ā ā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā :samples:android_lib ā Not KMP Ready ā
ā ā --- ā
ā ā ā
HasOnlyMultiplatformCompatibleDependencies ā
ā ā ā
HasOnlyKotlinFiles ā
ā ā ā IsAndroidLibrary ā
ā ā ā UsesJavaBaseImports ā
ā ā Java Base Library Usages ā
ā ā * import java.util.Date ā
ā ā /Users/samedwards/src/kmp-readiness/samples/android_lib/src/main/java/kmp4free/samples/android.lib/AndroidLib.kt:3 ā
ā ā ā DoesNotHaveKotlinJvmOrMultiplatformPlugin ā
ā ā Applied Plugins ā
ā ā * com.android.build.gradle.LibraryPlugin ā
ā ā * com.android.build.gradle.api.AndroidBasePlugin ā
ā ā * com.android.build.gradle.internal.plugins.LibraryPlugin ā
ā ā * com.android.build.gradle.internal.plugins.VersionCheckPlugin ā
ā ā * org.gradle.kotlin.dsl.provider.plugins.KotlinScriptBasePlugin ā
ā ā * org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper ā
ā ā ā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā :samples:jvm ā Not KMP Ready ā
ā ā --- ā
ā ā ā
HasOnlyKotlinFiles ā
ā ā ā
KotlinPluginEnabled ā
ā ā ā IncompatibleDependencies ā
ā ā * com.squareup.okhttp3:okhttp:4.9.3 ā
ā ā ā UsesJavaBaseImports ā
ā ā Java Base Library Usages ā
ā ā * import java.util.Arrays ā
ā ā /Users/samedwards/src/kmp-readiness/samples/jvm/src/main/java/kmp4free/samples/JvmLib.kt:3 ā
ā ā * val instant: java.time.Instant? = null ā
ā ā /Users/samedwards/src/kmp-readiness/samples/jvm/src/main/java/kmp4free/samples/JvmLib.kt:9 ā
ā ā ā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā :samples:jvm_kmp4free ā Not KMP Ready ā
ā ā --- ā
ā ā ā
HasOnlyMultiplatformCompatibleDependencies ā
ā ā ā
KotlinPluginEnabled ā
ā ā ā HasJavaFiles ā
ā ā * /Users/samedwards/src/kmp-readiness/samples/jvm_kmp4free/src/main/java/kmp4free/samples/ThisIsAJavaClass.java ā
ā ā ā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā :samples:multiplatform ā KMP Ready ā
ā ā --- ā
ā ā ā
HasOnlyMultiplatformCompatibleDependencies ā
ā ā ā
HasOnlyKotlinFiles ā
ā ā ā
MultiplatformPluginAlreadyEnabled ā
ā ā ā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā :samples:multiplatform_kmp4free ā KMP Ready ā
ā ā --- ā
ā ā ā
HasOnlyMultiplatformCompatibleDependencies ā
ā ā ā
HasOnlyKotlinFiles ā
ā ā ā
KotlinPluginEnabled ā
ā ā ā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Info/Debug Logging
Just 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.
Plugin Installation
Add the Snapshot Repo in your project's settings.gradle.kts
pluginManagement {
repositories {
// ...
maven { url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}
}
Add the Plugin on your project's build.gradle
plugins {
id("com.handstandsam.kmp-ready") version "0.1.0-SNAPSHOT"
}