* @see org.apache.tools.ant.Task#execute()
*/
public void execute() throws BuildException {
validateAttributes();
PBXProject proj = new PBXProject();
addToProject(proj);
if (getProjectFile().exists()) {
if (!getProjectFile().isDirectory())
throw new BuildException("Specified PBX project package is not a directory.");
} else
getProjectFile().mkdir();
File pbxprojFile = new File(getProjectFile(), "project.pbxproj");
if (!pbxprojFile.exists()) {
try {
pbxprojFile.createNewFile();
} catch (IOException x) {
throw new BuildException("Failed to create project.pbxproj PBX project package file: " + x);
}
}
try {
proj.save(pbxprojFile);
} catch (Exception x) {
throw new BuildException("Failed to save project.pbxproj Xcode project package file: " + x);
}
}