mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.66k stars 423 forks source link

In multiplatform projects, :shared:exportLibraryDefinitions exports all platform instead of only shared libraries #1020

Closed coletz closed 5 days ago

coletz commented 1 month ago

I'm working on a multiplatform app (android + iOS) with a common kotlin module (shared) and two different apps (androidApp in kotlin and iosApp in swift), so I'm not using multiplatform Compose.

On the android side everything works fine (I am applying the plugin straight into the android app), so only shared + androidApp libraries are included;

On the iOS side I cannot apply the plugin, since it is a swift application and has no gradle config, so I was thinking about listing the libraries used in the shared module, then adding the ios libraries "manually". The problem with this approach is that if I run "gradle :shared:exportLibraryDefinitions" I get a list of dependencies including everything, even the android libs defined in the androidApp module.

Am I approaching this in the wrong way? Or this (exporting only shared libs) is something not supported?

Thanks and sorry if I've misunderstood something

Details

Checklist

mikepenz commented 1 month ago

Thank you for the report.

Please have a look here in the README: https://github.com/mikepenz/AboutLibraries?tab=readme-ov-file#generate-dependency-information

More specifically you can pass the variant for the file to export:

# Filter exported definition by variant by passing `-PaboutLibraries.exportVariant==<VARIANT>`
./gradlew :app-wasm:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/resources/ -PaboutLibraries.exportVariant=wasmJs
./gradlew :app-wasm:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/resources/ -PaboutLibraries.exportVariant=jvm
mikepenz commented 5 days ago

Closing due to inactivity