Skip to content

Instantly share code, notes, and snippets.

@fire
Created October 7, 2014 08:25
Show Gist options
  • Save fire/8ef1b78481586fddb793 to your computer and use it in GitHub Desktop.
Save fire/8ef1b78481586fddb793 to your computer and use it in GitHub Desktop.
apply plugin: 'java'
task allJavadoc(type: Javadoc) {
group 'Documentation'
description 'Generates aggregated Javadoc API documentation for the main source code of all projects.'
source = ""
classpath = ""
destinationDir file("$project.buildDir/docs/javadoc/")
}
subprojects {
afterEvaluate {
plugins.withType(JavaPlugin).whenPluginAdded {
}
}
}
@darylteo
Copy link

darylteo commented Oct 7, 2014

apply plugin: 'java'
task allJavadoc(type: Javadoc) {
    group 'Documentation'
    description 'Generates aggregated Javadoc API documentation for the main source code of all projects.'

    // calling the source(Object obj) method of SourceTask 
    // http://www.gradle.org/docs/current/javadoc/org/gradle/api/tasks/SourceTask.html#source(java.lang.Object...)
    source { 
       subprojects.collect { child -> child.sourceSets?.main.allJava } 
    } 
    classpath = ...

    destinationDir file("$project.buildDir/docs/javadoc/")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment