/** * Create the ANT script based on the information * given in the constructor. * * @param status to report warnings to * @throws CoreException if something went wrong while generating the ant script */ public void run(MultiStatus status) throws CoreException { try { IPath[] classpath= getClasspath(fLaunchConfiguration); String mainClass= getMainClass(fLaunchConfiguration, status); String projectName= fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$ buildANTScript(fAntScriptLocation, projectName, fAbsJarfile, mainClass, convert(classpath)); } catch (FileNotFoundException e) { throw new CoreException( new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, Messages.format(FatJarPackagerMessages.FatJarPackageWizard_antScript_error_readingOutputFile, new Object[] { BasicElementLabels.getPathLabel(fAntScriptLocation, true), e.getLocalizedMessage() }) )); } catch (IOException e) { throw new CoreException( new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, Messages.format(FatJarPackagerMessages.FatJarPackageWizard_antScript_error_writingOutputFile, new Object[] { BasicElementLabels.getPathLabel(fAntScriptLocation, true), e.getLocalizedMessage() }) )); } }
/** * Adds dir properties to ANT-Buildfile: * <ul> * <li><property name="dir.buildfile" value="." /></li> * <li><property name="dir.workspace" value="${dir.buildfile}/../.." /></li> * <li><property name="dir.jarfile" value="C:/TEMP" /></li> * </ul> * * @param document the DOM document of the ant build script * @param project the project tag */ protected void addBaseDirProperties(Document document, Element project) { Node comment= document.createComment("define folder properties"); //$NON-NLS-1$ project.appendChild(comment); Element property= document.createElement("property"); //$NON-NLS-1$ property.setAttribute("name", ANT_PROPERTYNAME_DIR_BUILDFILE); //$NON-NLS-1$ property.setAttribute("value", "."); //$NON-NLS-1$ //$NON-NLS-2$ project.appendChild(property); property= document.createElement("property"); //$NON-NLS-1$ property.setAttribute("name", ANT_PROPERTYNAME_DIR_WORKSPACE); //$NON-NLS-1$ property.setAttribute("value", getWorkspaceRelativeDir()); //$NON-NLS-1$ project.appendChild(property); property= document.createElement("property"); //$NON-NLS-1$ property.setAttribute("name", ANT_PROPERTYNAME_DIR_JARFILE); //$NON-NLS-1$ property.setAttribute("value", getJarfileRelativeDir()); //$NON-NLS-1$ project.appendChild(property); }
public void exportAntScript(MultiStatus status) { if (!fAntScriptSaveCheckbox.getSelection()) return; if (canCreateAntScript(getShell())) { LaunchConfigurationElement element= fLauchConfigurationModel.get(fLaunchConfigurationCombo.getSelectionIndex()); Assert.isNotNull(element); FatJarAntExporter antExporter= getLibraryHandler().getAntExporter(fAntScriptLocation, fJarPackage.getAbsoluteJarLocation(), element.getLaunchConfiguration()); try { antExporter.run(status); } catch (CoreException e) { status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, FatJarPackagerMessages.FatJarPackageWizardPage_error_ant_script_generation_failed, e)); } } }
public void exportAntScript(MultiStatus status) { if (!fAntScriptSaveCheckbox.getSelection()) return; if (canCreateAntScript(getShell())) { LaunchConfigurationElement element= fLauchConfigurationModel.get(fLaunchConfigurationCombo.getSelectionIndex()); Assert.isNotNull(element); FatJarAntExporter antExporter= getLibraryHandler().getAntExporter(fAntScriptLocation, fJarPackage.getAbsoluteJarLocation(), element.getLaunchConfiguration()); try { antExporter.run(status); } catch (CoreException e) { status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, FatJarPackagerMessages.FatJarPackageWizardPage_error_ant_script_generation_failed, e)); } } }
/** * Create the ANT script based on the information * given in the constructor. * * @param status to report warnings to * @throws CoreException if something went wrong while generating the ant script */ public void run(MultiStatus status) throws CoreException { try { IPath[] classpath= getClasspath(fLaunchConfiguration); String mainClass= getMainClass(fLaunchConfiguration, status); String projectName= fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$ buildANTScript(fAntScriptLocation, projectName, fAbsJarfile, mainClass, convert(classpath)); } catch (FileNotFoundException e) { throw new CoreException( new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, Messages.format(FatJarPackagerMessages.FatJarPackageWizard_antScript_error_readingOutputFile, new Object[] { BasicElementLabels.getPathLabel(fAntScriptLocation, true), e.getLocalizedMessage() }) )); } catch (IOException e) { throw new CoreException( new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, Messages.format(FatJarPackagerMessages.FatJarPackageWizard_antScript_error_writingOutputFile, new Object[] { BasicElementLabels.getPathLabel(fAntScriptLocation, true), e.getLocalizedMessage() }) )); } }
/** * Adds dir properties to ANT-Buildfile: * <ul> * <li><property name="dir.buildfile" value="." /></li> * <li><property name="dir.workspace" value="${dir.buildfile}/../.." /></li> * <li><property name="dir.jarfile" value="C:/TEMP" /></li> * </ul> * * @param document the DOM document of the ant build script * @param project the project tag */ protected void addBaseDirProperties(Document document, Element project) { Node comment= document.createComment("define folder properties"); //$NON-NLS-1$ project.appendChild(comment); Element property= document.createElement("property"); //$NON-NLS-1$ property.setAttribute("name", ANT_PROPERTYNAME_DIR_BUILDFILE); //$NON-NLS-1$ property.setAttribute("value", "."); //$NON-NLS-1$ //$NON-NLS-2$ project.appendChild(property); property= document.createElement("property"); //$NON-NLS-1$ property.setAttribute("name", ANT_PROPERTYNAME_DIR_WORKSPACE); //$NON-NLS-1$ property.setAttribute("value", getWorkspaceRelativeDir()); //$NON-NLS-1$ project.appendChild(property); property= document.createElement("property"); //$NON-NLS-1$ property.setAttribute("name", ANT_PROPERTYNAME_DIR_JARFILE); //$NON-NLS-1$ property.setAttribute("value", getJarfileRelativeDir()); //$NON-NLS-1$ project.appendChild(property); }
public void exportAntScript(MultiStatus status) { if (!fAntScriptSaveCheckbox.getSelection()) return; if (canCreateAntScript(getShell())) { LaunchConfigurationElement element= fLauchConfigurationModel.get(fLaunchConfigurationCombo.getSelectionIndex()); Assert.isNotNull(element); FatJarAntExporter antExporter= getLibraryHandler().getAntExporter(fAntScriptLocation, fJarPackage.getAbsoluteJarLocation(), element.getLaunchConfiguration()); try { antExporter.run(status); } catch (CoreException e) { status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, FatJarPackagerMessages.FatJarPackageWizardPage_error_ant_script_generation_failed, e)); } } }