简体   繁体   English

Bintray 上的 Android 库缺少源和 javadoc

[英]Android Library on Bintray missing sources and javadoc

I am trying to publish an Android library written in Kotlin as an AAR on Bintray to distribute it.我正在尝试将用 Kotlin 编写的 Android 库作为 AAR 在 Bintray 上发布以分发它。 I have already configured the whole project following various resources that I found online, and the publishing via bintrayUpload goes smoothly.我已经根据我在网上找到的各种资源配置了整个项目,并且通过bintrayUpload发布很顺利。 Here 's my build.gradle.kts . 是我的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.我的库依赖于 RxJava 3,但在 Gradle 中导入我的库时,该库(和其他依赖项)不会自动下载,导致 Android Studio 抱怨所有 Rx 类。
  • I can't see the sources and the JavaDoc.我看不到源代码和 JavaDoc。

On Bintray, everything looks normal: I can see two JAR files ( -Javadoc and -sources`), one AAR, and the usual POM file.在 Bintray 上,一切看起来都很正常:我可以看到两个 JAR 文件( -Javadoc and -sources`)、一个 AAR 和通常的 POM 文件。 I've inspected all of them, and they contain everything I'm expecting, including the dependencies in the POM file.我检查了所有这些,它们包含我所期望的所有内容,包括 POM 文件中的依赖项。

You can inspect the full source code here and the Bintray artifact here .您可以在此处查看完整的源代码,并在此处查看Bintray工件。

What am I doing wrong?我究竟做错了什么?

I had the same problem with maven-publish plugin.我对maven-publish插件有同样的问题。 Sources were uploaded to maven repository but could not be downloaded together with aar .源代码已上传到 maven 存储库,但无法与aar一起下载。 Sources were not included in .module .源不包含在.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 .我找到了这个插件: aar ://plugins.gradle.org/plugin/xyz.tynn.android.sources - 与此一起,源代码与.module一起自动下载。

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 documentationhttps://developer.android.com/studio/build/maven-publish-plugin To use it all what has to be done is apply plugin: "xyz.tynn.android.sources" and publication configured according to official Android documentationhttps://developer.android.com/studio/build/maven-publish-plugin

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM