Android Library on Bintray missing sources and javadoc

Viewed 401

I am trying to publish an Android library written in Kotlin as an AAR on Bintray to distribute it. I have already configured the whole project following various resources that I found online, and the publishing via bintrayUpload goes smoothly. Here's my build.gradle.kts.

However, when I import the library in another project, I can reference all the classes correctly but:

  • My library depends on RxJava 3, but that (and other dependencies) are not automatically downloading when importing my library in Gradle, resulting in Android Studio complaining about all the Rx classes.
  • I can't see the sources and the JavaDoc.

On Bintray, everything looks normal: I can see two JAR files (-Javadoc and -sources`), one AAR, and the usual POM file. I've inspected all of them, and they contain everything I'm expecting, including the dependencies in the POM file.

You can inspect the full source code here and the Bintray artifact here.

What am I doing wrong?

1 Answers

I had the same problem with maven-publish plugin. Sources were uploaded to maven repository but could not be downloaded together with aar. Sources were not included in .module.

I have found this plugin: https://plugins.gradle.org/plugin/xyz.tynn.android.sources - with this, sources are included in .module and are automatically downloaded together with aar.

This plugin doens't require any extra tasks for generating sources neither adding extra artifacts.

To use it all what has to be done is apply plugin: "xyz.tynn.android.sources" and publication configured according to official Android documentation https://developer.android.com/studio/build/maven-publish-plugin

There is also plugin for JavaDoc https://github.com/tynn-xyz/BuildSrc/blob/master/README.md

Related