Javadoc including a list of files doesn't work

Here is what I’m doing:

task androidJavadocs(type: Javadoc) {

failOnError = false

classpath += project.files(android.plugin.getBootClasspath().join(File.pathSeparator))

println "Javadoc classpath: " + classpath.asPath

FileCollection publicSource = files(‘src/com/example/’,


include(copySpec {

from ‘source’

into ‘destination’

include { it.file in publicSource }


println "Javadoc sources: " + source.asPath


What is wrong with this?

There is no ‘include’ method that takes a ‘CopySpec’. (Where did you get this from?) Have you tried ‘include “com/example/”; include …’? Additionally, you’ll need to set ‘source’ (typically to some source set).

PS: Please always include the full error message.