// for each source set we will:
// 1) Add a new 'javaTemplates' or 'resourceTemplates' source dirs
String sourceSetName = ((DefaultSourceSet) sourceSet).getDisplayName();
SourceDirectorySet templates = new DefaultSourceDirectorySet(
sourceSetName + f.sourceSetNameEnd(), fileResolver);
templates.srcDir(dirPath);
sourceSet.getAllSource().source(templates);
// 2) create an GeneratorTask for this sourceSet following the gradle
// naming conventions via call to sourceSet.getTaskName()
final String taskName =