问题:
我想添加一些从Android SDK继承的JavaDoc。但Gradle JavaDoc似乎无法找到Android源代码,因此忽略了{@inheritDoc}
标记。
示例课程
public class MyCursor implements android.database.Cursor {
/**
* {@inheritDoc}
*/
public int getCount() {
return 42;
}
// ... All other interface methods
}
Gradle任务
def javadocTask = task("javadoc${variant.name.capitalize()}", type: Javadoc) {
description "Generates Javadoc for $variant.name."
group 'Docs'
source = variant.javaCompile.source
source files("${android.sdkDirectory}/sources/${android.compileSdkVersion}")
ext.androidJar = files(plugins.findPlugin("com.android.library").getBootClasspath())
classpath = files(variant.javaCompile.classpath.files) + ext.androidJar
include 'my/package/**'
exclude 'my/package/internal/**'
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
一些猜测:
Android SDK大量使用@hide
,导致JavaDoc生成崩溃。
使用exclude似乎也阻止从这些类继承。