Problem:
I want to add some JavaDoc that is inherited from the Android SDK. However Gradle JavaDoc doesn't seem to be able to find the Android source code and thus ignores the {@inheritDoc}
tag.
Example class
public class MyCursor implements android.database.Cursor {
/**
* {@inheritDoc}
*/
public int getCount() {
return 42;
}
// ... All other interface methods
}
Gradle task
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'
}
Some speculations:
Android SDK uses
@hide
a lot which crashes JavaDoc generation.using exclude also seems to prevent inheriting from those classes.