gradle-android-javadoc-plugin
Gradle plugin that generates Java Documentation from an Android Gradle project.
Works with the latest Gradle Android Tools version 2.1.3. This plugin is compiled using Java 8 hence you also need Java 8 in order to use it.
Set up
app/build.gradle or library/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.vanniktech:gradle-android-javadoc-plugin:0.2.1'
}
}
apply plugin: 'com.vanniktech.android.javadoc'
Information: This plugin is also available on Gradle plugins
Snapshots
Can be found here. Current one is:
classpath 'com.vanniktech:gradle-android-javadoc-plugin:0.2.2-SNAPSHOT'
Get Javadoc
./gradlew generateDebugJavadoc ./gradlew generateReleaseJavadoc
HTML reports
<subproject>/build/docs/javadoc/debug/index.html <subproject>/build/docs/javadoc/release/index.html
Get Javadoc archive
./gradlew generateDebugJavadocJar ./gradlew generateReleaseJavadocJar
Customize Plugin
androidJavadoc {
// variantFilter takes a closure that received an Android variant as parameter.
// Return true to generate javadoc task for this variant, false to do nothing
// This is the default closure :
variantFilter {
variant ->
if (variant) {
return true
}
else {
return false
}
}
// taskNameTransformer takes a closure to customise the task name.
// Task name pattern is "generate${
taskNameTransformer(variant).capitalize()
}
Javadoc"
// This is the default implementation :
taskNameTransformer {
variant ->
variant.name
}
// outputDir return the documentation output dir
// Default implementation :
outputDir = {
Project project ->
"${
project.buildDir
}
/docs/javadoc/"
}
}
License
Copyright (C) 2015 Vanniktech - Niklas Baudy
Licensed under the Apache License, Version 2.0