// DS: generate project file
getLog().debug("NAR: Writing project file...");
ProjectWriterEnum projectWriterEnum = new ProjectWriterEnum();
projectWriterEnum.setValue("msvc8");
ProjectDef projectDef = new ProjectDef();
projectDef.setType(projectWriterEnum);
String filename = null;
try {
File outputDir = new File(getTargetDirectory(), "vcproj");
if (!outputDir.exists()) {
boolean succeeded = outputDir.mkdir();
if (!succeeded) {
throw new MojoExecutionException(
"Unable to create directory: " + outputDir);
}
}
filename = outputDir + "/" + getMavenProject().getArtifactId();
File projFile = new File(filename);
projectDef.setOutfile(projFile.getCanonicalFile());
} catch (IOException e) {
throw new MojoExecutionException("Unable to create file: "
+ filename, e);
}
task.addProject(projectDef);