AntBuildExtender extender = proj.getLookup().lookup(AntBuildExtender.class); if (extender != null) { if (extender.getExtension("gfarchiveextend") == null) { // NOI18N AntBuildExtender.Extension ext = extender.addExtension("gfarchiveextend", jnlpBuildFile); // NOI18N ext.addDependency(target, "-extend-archive"); // NOI18N
/** * Remove SE native packaging extension and build script * @param project */ static void removeSENativeBundlerExtension(@NonNull Project project) throws IOException { final AntBuildExtender extender = project.getLookup().lookup(AntBuildExtender.class); if (extender != null) { AntBuildExtender.Extension extension = extender.getExtension(J2SEDEPLOY_EXTENSION); if (extension != null) { extender.removeExtension(J2SEDEPLOY_EXTENSION); } final FileObject buildExFo = project.getProjectDirectory().getFileObject(EXTENSION_BUILD_SCRIPT_PATH); if (buildExFo != null) { buildExFo.delete(); } } }
private FileObject updateJfxImpl() { // this operation must be finished before any user // action on this project involving Run, Build, Debug, etc. FileObject readmeFO = null; try { final AntBuildExtender extender = prj.getLookup().lookup(AntBuildExtender.class); if (extender == null) { LOGGER.log( Level.WARNING, "The project {0} ({1}) does not support AntBuildExtender.", //NOI18N new Object[] { ProjectUtils.getInformation(prj).getDisplayName(), FileUtil.getFileDisplayName(prj.getProjectDirectory()) }); } else { // update jfx-impl.xml on project open only if build-impl extension version is compatible if (extender.getExtension(JFXProjectUtils.getCurrentExtensionName()) != null) { readmeFO = JFXProjectUtils.updateJfxImpl(prj); } } } catch (Exception ex) { LOGGER.log(Level.WARNING, "Can't update JavaFX specific build script jfx-impl.xml: {0}", ex); // NOI18N } return readmeFO; }
AntBuildExtender.Extension ext = extender.getExtension("gfarchiveextend"); // NOI18N if (ext != null) { try { iae); extender.removeExtension("gfarchiveextend"); // NOI18N
/** * Adds dependencies of build-impl targets on jfx-impl targets * @param proj * @return true if success * @throws IOException */ static boolean addExtension(@NonNull Project proj) throws IOException { boolean res = false; FileObject projDir = proj.getProjectDirectory(); FileObject jfxBuildFile = projDir.getFileObject(JFX_BUILD_IMPL_PATH); AntBuildExtender extender = proj.getLookup().lookup(AntBuildExtender.class); if (extender != null) { assert jfxBuildFile != null; if (extender.getExtension(CURRENT_EXTENSION) == null) { // NOI18N AntBuildExtender.Extension ext = extender.addExtension(CURRENT_EXTENSION, jfxBuildFile); // NOI18N // NOTE: change in dependencies = change of metafile updates API; // do not forget to update CURRENT_EXTENSION and add the old one to OLD_EXTENSIONS ext.addDependency("-post-jar", "-jfx-copylibs"); // NOI18N ext.addDependency("-post-jar", "-rebase-libs"); //NOI18N ext.addDependency("-post-jar", "jfx-deployment"); //NOI18N ext.addDependency("run", "jar"); //NOI18N ext.addDependency("debug", "jar");//NOI18N ext.addDependency("profile", "jar");//NOI18N res = true; } } return res; }
private void updateIfNeeded( final Project project, final AntBuildExtender extender) { if (extender.getExtension(JFXProjectUtils.getCurrentExtensionName()) != null) { boolean needsUpdate = false; for (String oldExt : JFXProjectUtils.getOldExtensionNames()) { final AntBuildExtender.Extension extension = extender.getExtension(oldExt); if (extension != null) { extender.removeExtension(oldExt); needsUpdate = true;