autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

Module Advice for Kotlin Multiplatform

Open
#751 2 comments 0 reactions 0 assignees View on GitHub
enhancement toolchain:kotlin
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

**Feature Request**
Provide Module Advice for Modules that are "KMP Ready" or "commonMain compatible". I love the current feature that allows us to determine if an Android module could be a JVM module! I was wondering if we could go one step further to determine if it could be a multiplatform module by adding additional constraints.

**Describe the solution you'd like**

I'd like to get module advice (like you have with this [AndroidScore](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/blob/07ceec90d6c2b6e0ac9f0d511eb8b1759cbad0e9/src/main/kotlin/com/autonomousapps/model/ModuleAdvice.kt#L19-L76)) that would let me know if the module could be multiplatform compatible. If it was, then this means that the module would be compatible with `kmp4free` https://github.com/handstandsam/kmp4free

A few checks to consider:
* Are there any `java.util.*` imports? If so, how many?
* Are there any dependencies (including transitive) that are not compatible with Kotlin Multiplatform? This is the hard one. I can't think of a way of determining multi-platform compatibility other than having a database that could be programmatically updated. It could be a bundled file in this library (or elsewhere), or could be pulled down every time.

**Describe alternatives you've considered**

Manually going through JVM modules and seeing what their dependencies are.

**Additional context**

FYI: This is DIFFERENT from "Kotlin Multiplatform Support" Issue. https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/issues/228 This ticket would identify Android & JVM Modules that are "KMP Ready", but does not deal with scanning projects with a multiplatform structure.

Hopefully we'll get some good initial discussion here on this Twitter thread: https://twitter.com/HandstandSam/status/1552154145917784065

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing ModuleAdvice.kt implementation linked through AndroidScore and compare this request with the separate Kotlin Multiplatform Support issue 228. Define how advice should identify KMP-ready Android and JVM modules, including java.util imports and incompatible direct or transitive dependencies; done means the plugin reports that compatibility clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.