禁用Javadoc检查以获取Bintray上传 [英] Disable javadoc check for Bintray upload
问题描述
我正在尝试将我的图书馆的新版本上传到Bintray,但是我遇到了错误.
I am trying to upload a new version of my library to Bintray, however I am getting errors.
我所做的更改之一是向Javadoc添加自定义属性.例如:
One of the changes I made was to add a custom attribute to my Javadoc. For example:
/**
* The method does something.
*
* @param myParameter This is my parameter
* @see #anotherMethod(int)
* @attr ref R.styleable#MyLibrary_anAttribute
*/
我添加的自定义属性标记为@attr ref
,该标记将在生成Javadoc HTML时显示相关的XML属性(例如,在Android Developer文档中).我将其添加为IDE(Android Studio)中的自定义标签,但是在上传到Bintray时会导致错误.另外,我正在使用novoda bintray插件-这是我的build.gradle
的一部分.
The custom attribute tag I added was @attr ref
which would show related XML attributes when generating Javadoc HTML (like in Android Developer documentation). I added this as a custom tag in my IDE (Android Studio), but it causes an error when uploading to Bintray. Also, I am using the novoda bintray plugin - here is part of my build.gradle
.
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
...
publish {
...
}
因此,当我在终端中运行以下命令时:
So when I run the following command in terminal:
gradlew bintrayUpload -PbintrayUser=me -PbintrayKey=key -PdryRun=false
我收到以下错误:
:mylibrary:compileDebugJavaWithJavac UP-TO-DATE
:mylibrary:mavenAndroidJavadocs
C:\Users\...\ALibraryFile.java:216: error: unknown tag: attr
* @attr ref R.styleable#MyLibrary_anAttribute
...
13 errors
:mylibrary:mavenAndroidJavadocs FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mylibrary:mavenAndroidJavadocs'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): 'C:\Users\...\build\tmp\mavenAndroidJavadocs\javadoc.options'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 12.711 secs
有什么办法解决这个问题(例如,禁用此Javadoc检查?)?
Is there any way round this (e.g. disabling this javadoc check?)?
推荐答案
我设法通过将以下内容添加到项目的build.gradle
中来解决了我的问题:
I managed to solve my issue by adding the following into my project's build.gradle
:
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
}
从GitHub问题的评论中找到了答案-您还可以查看解决此问题的GitHub提交.
这篇关于禁用Javadoc检查以获取Bintray上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!