Regression: NullPointerException in Gradle 2.1-rc-1

Executing ‘gradle assemble’ on https://github.com/huxi/sulky throws a ‘NullPointerException’ with Gradle 2.1-rc-1.

See https://travis-ci.org/huxi/sulky/jobs/33060922 for the build and http://pastebin.com/sZbtqEHy for the stacktrace.

The task that throws the exception looks like this:

task javadocAll(type: Javadoc) {
 destinationDir = file("$buildDir/javadocAll")
 source = files { subprojects.collect { it.sourceSets.main.java } }
 classpath = files { subprojects.collect { it.sourceSets.main.compileClasspath } }
}

Am I right in assuming that you’re not applying the ‘JavaBasePlugin’ to the project that contains this task definition?

Correct. I only apply ‘BasePlugin’. It’s a multi-module-project build were this task in the rootproject produces the javadoc for all subprojects.