private List<CompileTask> generateTasks(Set<File> sources, SourceMapping mapping) throws MojoExecutionException {
List<CompileTask> tasks = new LinkedList<CompileTask>();
try {
String root = sourceDirectory.getCanonicalPath();
for (File src : sources) {
String srcName = getRelativePath(root, src);
try {
File destination = mapping.getTargetFiles(outputDirectory, srcName).iterator().next();
createDestination(destination.getParentFile());
tasks.add(new CompileTask(src, destination, log, verbose));
}
catch (InclusionScanException e) {
throw new MojoExecutionException("Error compiling report design : " + src, e);
}
}
}
catch (IOException e) {
throw new MojoExecutionException("Could not getCanonicalPath from source directory " + sourceDirectory, e);
}
return tasks;
}