protected State getBuildState() { State main = TargetPlatformHelper.getState(); if (fStateCopy == null) copyState(main); //this state is expected to get platform properties set by pde.build and re-resolved there. //TODO should main.getPlatformProperties() be passed to pde/build? return fStateCopy; }
public SourcePluginFilter() { fState = TargetPlatformHelper.getPDEState(); }
@Override public String getDescription() { if (TargetPlatformHelper.getTargetVersion() >= 3.4) return PDEUIMessages.UpdateActivationResolution_bundleActivationPolicy_label; return PDEUIMessages.UpdateActivationResolution_lazyStart_label; }
/** * Returns the list of bundles in the osgi.bundles property of the * platform config ini, or a set of default bundles if the property * could not be found. * @return string list of bundles */ public static String getBundleList() { Properties properties = getConfigIniProperties(); String osgiBundles = properties == null ? null : properties.getProperty("osgi.bundles"); //$NON-NLS-1$ if (osgiBundles == null) { osgiBundles = getDefaultBundleList(); } else { osgiBundles = stripPathInformation(osgiBundles); } return osgiBundles; }
/** * Returns the ID for the default application * (<code>org.eclipse.core.runtime.applications</code> extension) for the current target * platform. * <p> * If none could be determined, then <code>org.eclipse.ui.ide.workbench</code> * application is returned. * </p> * @return the default application to run when launching an Eclipse application */ public static String getDefaultApplication() { Properties config = TargetPlatformHelper.getConfigIniProperties(); Set<String> set = TargetPlatformHelper.getApplicationNameSet(); if (config != null) { String application = (String) config.get(APPLICATION_PROPERTY); if (application != null && set.contains(application)) return application; } return IDE_APPLICATION; }
/** * Returns the ID for the default product * (<code>org.eclipse.core.runtime.products</code> extension) for the current target platform, * or <code>null</code> if none can be determined. * * If any of the * * @return the ID for the default product or <code>null</code> if none could be determined */ public static String getDefaultProduct() { Properties config = TargetPlatformHelper.getConfigIniProperties(); Set<String> set = TargetPlatformHelper.getProductNameSet(); if (config != null) { String product = (String) config.get(PRODUCT_PROPERTY); if (product != null && set.contains(product)) return product; } if (set.contains(SDK_PRODUCT)) return SDK_PRODUCT; return set.contains(PLATFORM_PRODUCT) ? PLATFORM_PRODUCT : null; }
String url = ClasspathHelper.getDevEntriesProperties(project.getLocation().addTrailingSeparator().toString() + "dev.properties", false); //$NON-NLS-1$ generator.setDevEntries(url); generator.setPDEState(TargetPlatformHelper.getState()); generator.setNextId(TargetPlatformHelper.getPDEState().getNextId()); generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState()));
protected void setupGenerator(BuildScriptGenerator generator, String featureID, String versionId, String os, String ws, String arch, String featureLocation) throws CoreException { generator.setBuildingOSGi(true); generator.setChildren(true); generator.setWorkingDirectory(featureLocation); generator.setDevEntries(getDevProperties()); generator.setElements(new String[] {"feature@" + featureID + (versionId == null ? "" : ":" + versionId)}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ generator.setPluginPath(getPaths()); generator.setReportResolutionErrors(false); generator.setIgnoreMissingPropertiesFile(true); generator.setSignJars(fInfo.signingInfo != null); generator.setGenerateJnlp(fInfo.jnlpInfo != null); String config = os + ',' + ws + ',' + arch; AbstractScriptGenerator.setConfigInfo(config); //This needs to be set before we set the format String format; if (fInfo.toDirectory) format = config + '-' + IXMLConstants.FORMAT_FOLDER; else format = config + '-' + IXMLConstants.FORMAT_ANTZIP; generator.setArchivesFormat(format); generator.setPDEState(getState(os, ws, arch)); generator.setNextId(TargetPlatformHelper.getPDEState().getNextId()); generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState())); AbstractScriptGenerator.setForceUpdateJar(false); AbstractScriptGenerator.setEmbeddedSource(fInfo.exportSource); }
public static String getBundleList() { Properties properties = getConfigIniProperties(); String osgiBundles = properties == null ? null : properties.getProperty("osgi.bundles"); //$NON-NLS-1$ if (osgiBundles == null) { StringBuffer buffer = new StringBuffer(); if (getTargetVersion() > 3.1) { buffer.append("org.eclipse.equinox.common@2:start,"); //$NON-NLS-1$ buffer.append("org.eclipse.update.configurator@3:start,"); //$NON-NLS-1$ buffer.append("org.eclipse.core.runtime@start"); //$NON-NLS-1$ } else { buffer.append("org.eclipse.core.runtime@2:start,"); //$NON-NLS-1$ buffer.append("org.eclipse.update.configurator@3:start"); //$NON-NLS-1$ } osgiBundles = buffer.toString(); } else { osgiBundles = stripPathInformation(osgiBundles); } return osgiBundles; }
@Override public String getTargetVersion() { return fTarget != null ? fTarget : TargetPlatformHelper.getTargetVersionString(); }
public BundleValidationOperation(IPluginModelBase[] models) { this(models, new Dictionary[] { TargetPlatformHelper.getTargetEnvironment()}); }
public static void createBundleForFramework(IProject project, HashMap newProps, IProgressMonitor monitor) throws CoreException { try { File outputFile = new File(project.getLocation().append( "META-INF/MANIFEST.MF").toOSString()); //$NON-NLS-1$ File inputFile = new File(project.getLocation().toOSString()); PluginConverter converter = PluginConverter.getDefault(); double version = TargetPlatformHelper.getTargetVersion(); String versionString = version <= 3.1 ? ICoreConstants.TARGET31 : TargetPlatformHelper.getTargetVersionString(); converter.convertManifest(inputFile, outputFile, false, versionString, true, null); Map prop = getProperties(outputFile, newProps); prop.remove(ICoreConstants.ECLIPSE_AUTOSTART); prop.remove(ICoreConstants.ECLIPSE_LAZYSTART); converter.writeManifest(outputFile, prop, false); project.refreshLocal(IResource.DEPTH_INFINITE, null); } catch (PluginConversionException e) { } catch (CoreException e) { } finally { monitor.done(); } }
/** * Delegates to all tabs to set defaults. * It then sets program and VM arguments based on values on the * <b>Plug-in Development > Target Platform > Launching Arguments</b> preference page. * * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { super.setDefaults(configuration); if (TargetPlatformHelper.usesNewApplicationModel()) configuration.setAttribute(IPDEConstants.LAUNCHER_PDE_VERSION, "3.3"); //$NON-NLS-1$ else if (TargetPlatformHelper.getTargetVersion() >= 3.2) configuration.setAttribute(IPDEConstants.LAUNCHER_PDE_VERSION, "3.2a"); //$NON-NLS-1$ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, PDESourcePathProvider.ID); // Set Program/VM arguments with preference values String programArgs = LaunchArgumentsHelper.getInitialProgramArguments().trim(); if (programArgs.length() > 0) configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArgs); String vmArgs = LaunchArgumentsHelper.getInitialVMArguments().trim(); if (vmArgs.length() > 0) configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs); configuration.setAttribute(IPDEConstants.APPEND_ARGS_EXPLICITLY, true); }
properties = TargetPlatformHelper.getConfigIniProperties(); properties.setProperty(PROP_OSGI_BUNDLES, computeOSGiBundles(TargetPlatformHelper.stripPathInformation(bundleList), bundles, bundlesWithStartLevels)); } else { String templateLoc = configuration.getAttribute(IPDELauncherConstants.CONFIG_TEMPLATE_LOCATION, (String) null); properties.setProperty(PROP_OSGI_BUNDLES, TargetPlatformHelper.stripPathInformation(osgiBundles));
private Set<?> getProductNameSet() { if (fProductSet == null) fProductSet = TargetPlatformHelper.getProductNameSet(); return fProductSet; }
public static Dictionary[] getPlatformProperties(String[] profiles, MinimalState state) { if (profiles == null || profiles.length == 0) return new Dictionary[] {getTargetEnvironment()}; // add java profiles for those EE's that have a .profile file in the current system bundle ArrayList result = new ArrayList(profiles.length); for (int i = 0; i < profiles.length; i++) { Properties profileProps = getJavaProfileProperties(profiles[i], state.getState()); if (profileProps != null) { Dictionary props = TargetPlatformHelper.getTargetEnvironment(); String systemPackages = profileProps.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES); if (systemPackages != null) props.put(Constants.FRAMEWORK_SYSTEMPACKAGES, systemPackages); String ee = profileProps.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT); if (ee != null) props.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee); result.add(props); } } if (result.size() > 0) return (Dictionary[])result.toArray(new Dictionary[result.size()]); return new Dictionary[] {TargetPlatformHelper.getTargetEnvironment()}; }
protected String[] getPaths() { return TargetPlatformHelper.getFeaturePaths(); }
private void initializeBundleState() { if (fStartLevels == null) fStartLevels = new HashMap(); Properties props = TargetPlatformHelper.getConfigIniProperties(); if (props != null) { String value = (String) props.get("osgi.bundles"); //$NON-NLS-1$ if (value != null) { StringTokenizer tokenizer = new StringTokenizer(value, ","); //$NON-NLS-1$ while (tokenizer.hasMoreTokens()) { String tokenValue = tokenizer.nextToken(); int index = tokenValue.indexOf("@"); //$NON-NLS-1$ if (index > 0) { String bundle = tokenValue.substring(0, index).trim(); fStartLevels.put(bundle, getStartValue(tokenValue.substring(index))); } } } } }
setActivationPolicy(Constants.ACTIVATION_LAZY); String latest = TargetPlatformHelper.getTargetVersionString(); IPluginModelBase model = PluginRegistry.findModel(project); if (model != null) { IPluginBase base = model.getPluginBase(); String tv = TargetPlatformHelper.getTargetVersionForSchemaVersion(base.getSchemaVersion()); if (!tv.equals(latest)) { setTargetVersion(tv);
protected void makeScripts(IProgressMonitor monitor) throws InvocationTargetException, CoreException { AJBuildScriptGenerator generator = new AJBuildScriptGenerator(); AJBuildScriptGenerator.setEmbeddedSource(AbstractScriptGenerator .getDefaultEmbeddedSource()); AJBuildScriptGenerator.setForceUpdateJar(AbstractScriptGenerator .getForceUpdateJarFormat()); AJBuildScriptGenerator.setConfigInfo(AbstractScriptGenerator .getDefaultConfigInfos()); IProject project = fManifestFile.getProject(); List inpath = getInpath(project); List aspectpath = getAspectpath(project); generator.setInpath(inpath); generator.setAspectpath(aspectpath); generator.setWorkingDirectory(project.getLocation().toOSString()); String url = ClasspathHelper.getDevEntriesProperties(project .getLocation().addTrailingSeparator().toString() + "dev.properties", false); //$NON-NLS-1$ generator.setDevEntries(url); generator.setPDEState(TargetPlatformHelper.getState()); generator.setNextId(TargetPlatformHelper.getPDEState().getNextId()); generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState())); generator.setBuildingOSGi(true); IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(project); generator.setElements(new String[] { "plugin@" +model.getPluginBase().getId() }); //$NON-NLS-1$ generator.generate(); }