vanniktech / gradle-maven-publish-plugin

A Gradle plugin that publishes your Android and Kotlin libraries, including sources and javadoc, to Maven Central or any other Nexus instance.
https://vanniktech.github.io/gradle-maven-publish-plugin
Apache License 2.0
1.3k stars 119 forks source link

Multi-variant Android Library sources? #828

Closed ianthetechie closed 1 month ago

ianthetechie commented 2 months ago

I observed when debugging some libraries published with the new plugin that multi-variant libraries do not automatically download sources or documentation in IntelliJ.

I assumed that I had just overlooked something in my publishing config, but it looks like the doc and sources JARs are all there. Here's an example repository listing: https://repo.maven.apache.org/maven2/io/github/rallista/maplibre-compose/0.0.18/.

In the case of sources, Android Studio does not give any options / quick fixes. For docs, I do get a download prompt as shown below when hovering on an item in source:

image

However, clicking the button results an a cryptic gradle error:

image

I have a sneaking suspicion that this is related to the structure of the Android multi-variant library, but I frankly don't know enough to be sure. This looks at least somewhat related: https://medium.com/glovo-engineering/publishing-a-variant-aware-android-library-with-its-sources-c61387323963.

Any ideas?

gabrielittner commented 1 month ago

In Android Studio there is an experimental option to enable support for source jars of multi variant libraries:

Screenshot 2024-09-19 at 19 48 30

More details can be found here: https://issuetracker.google.com/issues/197636221. I'm not sure if IntelliJ exposes a similar kind of option anywhere or whether it will only start supporting it when the Android plugin supports it by default.

ianthetechie commented 1 month ago

Hmmmm interesting... I tried enabling this, but it doesn't seem to have any effect.for my use cases :/

gabrielittner commented 1 month ago

Could you comment that on the Google issue tracker? From the publishing side everything looks fine. Unfortunately the whole multi variant publishing feature has been in this weird state ever since it was added.