dependency-analysis-gradle-plugin
dependency-analysis-gradle-plugin copied to clipboard
Support Kotlin multiplatform
Running the buildHealth task on apollo-android returns useful information but it looks like the plugin has some difficulties coping with multiplatform projects. For an exemple:
$ ./gradlew clean :apollo-normalized-cache-sqlite:aggregateAdvice
> Task :apollo-normalized-cache-sqlite:aggregateAdvice
Unused dependencies which should be removed:
- null(project(":apollo-api"))
Transitively used dependencies that should be declared directly as indicated:
- null(project(":apollo-api"))
- api("org.jetbrains.kotlin:kotlin-stdlib:1.3.72")
- api(project(":apollo-normalized-cache-api"))
- api("androidx.sqlite:sqlite:2.1.0")
- api("com.squareup.sqldelight:runtime-jvm:1.3.0")
- the configuration of
apollo-apiis not recognized andnullis displayed instead :apollo-normalized-cache-apiis already added as aapidependency on thecommonMainsourceSet so I think it shouldn't be reported- the module has both JVM and Android targets and it's not clear whether the report is taking into account JVM, Android or both
This can be reproduced with the dependency-analysis branch
Resolved with https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/pull/249.
Can we reopen this one? With latest main, multiplatform projects are skipped with No main source set. No analysis performed.
Also, multiplatform publication have a "common" publication that is used as a pointer to the individual platform publications and using them triggers false positives, even if using them in non-multiplatform projects:
For an exemple:
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
Will be trigger:
Transitively used dependencies that should be declared directly as indicated:
- api("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.3.9")
Even though it's mostly correct to only include the "common" publication and let gradle decide the implementation.
This can be reproduced with the use-dependency-analysis branch of apollo-android: https://github.com/apollographql/apollo-android/tree/use-dependency-analysis
I can provide a more minimal exemple if it helps.
I think it will require a focused effort to support kotlin multiplatform, rather than trying to fix seeming bugs in an ad hoc manner. I will reopen this ticket with that in mind.
Hello. Are there any updates on supporting KMM projects? It is a highly anticipated feature by our team. Thank you.