if (todir != null && todir.exists() && !todir.isDirectory()) {
throw new BuildException("destination directory should be a directory !");
}
PluginService pluginService = (PluginService) getProject().getReference(
EasyAntMagicNames.PLUGIN_SERVICE_INSTANCE);
try {
EasyAntReport easyantReport = pluginService.getPluginInfo(moduleIvy, sourceDirectory, conf);
ModuleRevisionId moduleRevisionId = easyantReport.getModuleDescriptor().getModuleRevisionId();
File reportFile = new File(todir, getOutputPattern(moduleRevisionId, conf, "xml"));
todir.mkdirs();
OutputStream stream = new FileOutputStream(reportFile);
XMLEasyAntReportWriter writer = new XMLEasyAntReportWriter();