jnlpBuildFile.delete();
}
}
static void extendBuildXml(Project proj, String target) throws IOException {
FileObject projDir = proj.getProjectDirectory();
final FileObject buildXmlFO = projDir.getFileObject("build.xml"); // NOI18N
if (null == buildXmlFO) {
// eject
return;
}
File buildXmlFile = FileUtil.toFile(buildXmlFO);
try {
XMLUtil.parse(new InputSource(buildXmlFile.toURI().toString()), false, true, null, null);
} catch (SAXException ex) {
Exceptions.printStackTrace(ex);
}
FileObject jnlpBuildFile = projDir.getFileObject("nbproject/extendRun.xml"); // NOI18N
AntBuildExtender extender = proj.getLookup().lookup(AntBuildExtender.class);
if (extender != null) {
if (extender.getExtension("sfrunextend") == null) { // NOI18N
AntBuildExtender.Extension ext = extender.addExtension("sfrunextend", jnlpBuildFile); // NOI18N
ext.addDependency(target, "-extend-run"); // NOI18N