private static void configureForSourceSet(final SourceSet sourceSet, final SourceDirectorySet sourceDirectorySet, AbstractCompile compile, final Project target) { compile.setDescription("Compiles the " + sourceDirectorySet.getDisplayName() + "."); compile.setSource(sourceSet.getJava()); compile.getConventionMapping().map("classpath", () -> sourceSet.getCompileClasspath().plus(target.files(sourceSet.getJava().getOutputDir()))); configureOutputDirectoryForSourceSet(sourceSet, sourceDirectorySet, compile, target); }