functionalSourceSet.add(javaSourceSet);
JvmResourceSet resourceSet = instantiator.newInstance(DefaultJvmResourceSet.class, "resources", sourceSet.getResources(), functionalSourceSet);
functionalSourceSet.add(resourceSet);
BinaryContainer binaryContainer = project.getExtensions().getByType(BinaryContainer.class);
ClassDirectoryBinarySpec binary = binaryContainer.create(String.format("%sClasses", sourceSet.getName()), ClassDirectoryBinarySpec.class);
ConventionMapping conventionMapping = new DslObject(binary).getConventionMapping();
conventionMapping.map("classesDir", new Callable<File>() {
public File call() throws Exception {
return sourceSet.getOutput().getClassesDir();
}
});
conventionMapping.map("resourcesDir", new Callable<File>() {
public File call() throws Exception {
return sourceSet.getOutput().getResourcesDir();
}
});
binary.getSource().add(javaSourceSet);
binary.getSource().add(resourceSet);
binary.builtBy(sourceSet.getOutput().getDirs());
}
});
}