Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 3 tasks
coletz opened this issue Sep 8, 2024 · 1 comment

Comments

@coletz
Copy link

coletz commented Sep 8, 2024

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

  • [V] Used library version: 11.2.3
  •  Used support library version: not sure about what this refer to...?
  • [V] Used gradle build tools version: 8.7
  • [V] Used tooling / Android Studio version: AS Koala | 2024.1.1 Patch 1
  • [V] Other used libraries, potential conflicting libraries: none afaik

Checklist

@mikepenz
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants