diff --git a/build.gradle b/build.gradle index c3e869e..6c9a99c 100644 --- a/build.gradle +++ b/build.gradle @@ -22,3 +22,24 @@ ext { minSdkVersion = 8 targetSdkVersion = 23 } + +task aggregateJavadocs(type: Javadoc) { + destinationDir = file("$buildDir/docs/javadoc") +} + +subprojects { + afterEvaluate { + if (plugins.hasPlugin(JavaPlugin)) { + rootProject.tasks.aggregateJavadocs { + source += javadoc.source + classpath += files(javadoc.classpath) + } + } + if (plugins.hasPlugin(com.android.build.gradle.LibraryPlugin)) { + rootProject.tasks.aggregateJavadocs { + source += files(android.sourceSets.main.java.srcDirs) + classpath += files(project.files(android.getBootClasspath().join(File.pathSeparator))) + } + } + } +}