}
private static void setupTask(ProjectInternal project, SourceSet sourceSet, Flavor f) {
String dirPath = String.format("src/%s/%s", sourceSet.getName(), f.templatesPart());
FileResolver fileResolver = project.getFileResolver();
File dir = fileResolver.resolve(dirPath);
if (!dir.exists())
return;
// for each source set we will:
// 1) Add a new 'javaTemplates' or 'resourceTemplates' source dirs
String sourceSetName = ((DefaultSourceSet) sourceSet).getDisplayName();