Javadoc custom task on subprojects

Hi,

I have multi project setup

parent /

  • services

  • common

  • library

  • store

I have settings which include the subproject. I want to run doclet on services, common, library. I have coded mydoc task in parent gradle file. But it says mydoc is skipped: :mydoc (Thread[main,5,main]) started. :mydoc Skipping task ‘:mydoc’ as it has no source files. :mydoc UP-TO-DATE :mydoc (Thread[main,5,main]) completed. Took 0.0 secs.

How do I configure mydoc with sources. I have attempted already as below:

//parent build.gradle

task mydoc(type: Javadoc) << {

allprojects.each {println it.name, it.SourceSets.each { print “,” + it.name + “,”; }; }

source = sourceSets.main.allJava + project(":services").sourceSets.main.allJava + project(":common").sourceSets.main.allJava + project(":library").sourceSets.main.allJava

classpath = sourceSets.main.compileClasspath + project(":services").sourceSets.main.compileClasspath + project(":common").sourceSets.main.compileClasspath + project(":library").sourceSets.main.compileClasspath

//exclude { it.getName().equals(‘Association.java’); }

//options.docletpath = [file(‘D:/download/dsoftware/google/doclava-1.0.6/doclava-1.0.6.jar’)]

options.docletpath = [file(‘D:/learn/java/doclava-read-only/build/doclava-1.0.7-SNAPSHOT.jar’),file(‘D:/download/dsoftware/google/doclava-1.0.6/doclava-1.0.6.jar’)]

options.doclet = ‘com.google.doclava.Doclava’

options.bootClasspath = [file(‘d:/software/jdk/jdk1.6.0_38/jre/lib/rt.jar’), file(‘d:/software/android-sdk-windows/platforms/android-19/android.jar’)]

title = “Doclava” }