Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 131513 Details for
Bug 269111
[launcher] start levels don't get added when launching without a configurator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
org.eclipse.pde.patch
clipboard.txt (text/plain), 31.91 KB, created by
Chris Aniszczyk
on 2009-04-10 12:48:27 EDT
(
hide
)
Description:
org.eclipse.pde.patch
Filename:
MIME Type:
Creator:
Chris Aniszczyk
Created:
2009-04-10 12:48:27 EDT
Size:
31.91 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/P2Utils.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/P2Utils.java,v >retrieving revision 1.19 >diff -u -r1.19 P2Utils.java >--- src/org/eclipse/pde/internal/core/P2Utils.java 15 Mar 2009 21:40:01 -0000 1.19 >+++ src/org/eclipse/pde/internal/core/P2Utils.java 10 Apr 2009 16:48:28 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * EclipseSource Corporation - ongoing enhancements > *******************************************************************************/ > package org.eclipse.pde.internal.core; > >@@ -18,7 +19,6 @@ > import org.eclipse.core.runtime.*; > import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo; > import org.eclipse.equinox.internal.provisional.simpleconfigurator.manipulator.SimpleConfiguratorManipulator; >-import org.eclipse.osgi.service.resolver.BundleDescription; > import org.eclipse.pde.core.plugin.IPluginBase; > import org.eclipse.pde.core.plugin.IPluginModelBase; > import org.eclipse.pde.internal.build.BundleHelper; >@@ -189,12 +189,35 @@ > * @param defaultStartLevel start level to use when "default" is the start level > * @param defaultAutoStart auto start setting to use when "default" is the auto start setting > * @param directory configuration directory to create the files in >+ * @param osgiBundleList a list of bundles coming from a template config.ini > * @return URL location of the bundles.info or <code>null</code> > */ >- public static URL writeBundlesTxt(Map bundles, int defaultStartLevel, boolean defaultAutoStart, File directory) { >+ public static URL writeBundlesTxt(Map bundles, int defaultStartLevel, boolean defaultAutoStart, File directory, String osgiBundleList) { > if (bundles.size() == 0) { > return null; > } >+ >+ // Parse the osgi bundle list for start levels >+ Map osgiStartLevels = new HashMap(); >+ if (osgiBundleList != null) { >+ StringTokenizer tokenizer = new StringTokenizer(osgiBundleList, ","); //$NON-NLS-1$ >+ while (tokenizer.hasMoreTokens()) { >+ String token = tokenizer.nextToken(); >+ int index = token.indexOf('@'); >+ if (index != -1) { >+ String modelName = token.substring(0, index); >+ String startData = token.substring(index + 1); >+ index = startData.indexOf(':'); >+ String level = index > 0 ? startData.substring(0, index) : "default"; //$NON-NLS-1$ >+ String auto = index > 0 && index < startData.length() - 1 ? startData.substring(index + 1) : "default"; //$NON-NLS-1$ >+ if ("start".equals(auto)) { //$NON-NLS-1$ >+ auto = "true"; //$NON-NLS-1$ >+ } >+ osgiStartLevels.put(modelName, level + ':' + auto); >+ } >+ } >+ } >+ > List bundleInfo = new ArrayList(bundles.size()); > List sourceInfo = new ArrayList(bundles.size()); > for (Iterator iterator = bundles.keySet().iterator(); iterator.hasNext();) { >@@ -215,6 +238,10 @@ > info.setSymbolicName(base.getId()); > info.setVersion(base.getVersion()); > String currentLevel = (String) bundles.get(currentModel); >+ // override the start level setting if something comes from the config.ini >+ if (osgiStartLevels.containsKey(base.getId())) { >+ currentLevel = (String) osgiStartLevels.get(base.getId()); >+ } > int index = currentLevel.indexOf(':'); > String levelString = index > 0 ? currentLevel.substring(0, index) : "default"; //$NON-NLS-1$ > String auto = index > 0 && index < currentLevel.length() - 1 ? currentLevel.substring(index + 1) : "default"; //$NON-NLS-1$ >@@ -269,73 +296,4 @@ > } > } > >- /** >- * Creates a bundles.info file in the given directory containing the name, >- * version, location, start level and expected state of every bundle in the >- * given collection. Will also create a source.info file containing >- * a list of all source bundles found in the given collection. If a bundle >- * has a specified start level in the osgi bundle list, that value is used >- * instead of the default. Returns the URL location of the bundle.txt or >- * <code>null</code> if there was a problem creating it. >- * >- * @param bundles collection of IPluginModelBase objects to write into the bundles.info/source.info >- * @param osgiBundleList comma separated list of bundles specified in a template config.ini, used to override start levels >- * @param directory directory to create the bundles.info and source.info files in >- * @return URL location of the bundles.info or <code>null</code> >- */ >- public static URL writeBundlesTxt(Collection bundles, String osgiBundleList, File directory) { >- // Parse the osgi bundle list for start levels >- Map osgiStartLevels = new HashMap(); >- StringTokenizer tokenizer = new StringTokenizer(osgiBundleList, ","); //$NON-NLS-1$ >- while (tokenizer.hasMoreTokens()) { >- String token = tokenizer.nextToken(); >- int index = token.indexOf('@'); >- if (index != -1) { >- String modelName = token.substring(0, index); >- String startData = token.substring(index + 1); >- index = startData.indexOf(':'); >- String level = index > 0 ? startData.substring(0, index) : "default"; //$NON-NLS-1$ >- String auto = index > 0 && index < startData.length() - 1 ? startData.substring(index + 1) : "default"; //$NON-NLS-1$ >- if ("start".equals(auto)) { //$NON-NLS-1$ >- auto = "true"; //$NON-NLS-1$ >- } >- osgiStartLevels.put(modelName, level + ':' + auto); >- } >- } >- >- // Create a map of bundles to start levels >- String defaultAppend = "default:default"; //$NON-NLS-1$ >- Map bundleMap = new HashMap(bundles.size()); >- for (Iterator iterator = bundles.iterator(); iterator.hasNext();) { >- IPluginModelBase currentModel = (IPluginModelBase) iterator.next(); >- BundleDescription desc = currentModel.getBundleDescription(); >- if (desc != null) { >- String modelName = desc.getSymbolicName(); >- if (modelName != null && osgiStartLevels.containsKey(modelName)) { >- bundleMap.put(currentModel, osgiStartLevels.get(modelName)); >- } else if (IPDEBuildConstants.BUNDLE_DS.equals(modelName)) { >- bundleMap.put(currentModel, "1:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR.equals(modelName)) { >- bundleMap.put(currentModel, "1:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_EQUINOX_COMMON.equals(modelName)) { >- bundleMap.put(currentModel, "2:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_OSGI.equals(modelName)) { >- bundleMap.put(currentModel, "-1:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR.equals(modelName)) { >- bundleMap.put(currentModel, "3:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(modelName)) { >- if (TargetPlatformHelper.getTargetVersion() > 3.1) { >- bundleMap.put(currentModel, "default:true"); //$NON-NLS-1$ >- } else { >- bundleMap.put(currentModel, "2:true"); //$NON-NLS-1$ >- } >- } else { >- bundleMap.put(currentModel, defaultAppend); >- } >- } >- } >- >- return writeBundlesTxt(bundleMap, 4, false, directory); >- } >- > } >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/launcher/OSGiValidationOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiValidationOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 OSGiValidationOperation.java >--- src/org/eclipse/pde/internal/ui/launcher/OSGiValidationOperation.java 29 Apr 2007 02:02:08 -0000 1.2 >+++ src/org/eclipse/pde/internal/ui/launcher/OSGiValidationOperation.java 10 Apr 2009 16:48:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 IBM Corporation and others. >+ * Copyright (c) 2007, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * EclipseSource Corporation - ongoing enhancements > *******************************************************************************/ > package org.eclipse.pde.internal.ui.launcher; > >@@ -21,7 +22,7 @@ > } > > protected IPluginModelBase[] getModels() throws CoreException { >- return BundleLauncherHelper.getMergedBundles(fLaunchConfiguration); >+ return BundleLauncherHelper.getMergedBundles(fLaunchConfiguration, true); > } > > } >Index: src/org/eclipse/pde/internal/ui/launcher/BundleLauncherHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/BundleLauncherHelper.java,v >retrieving revision 1.11 >diff -u -r1.11 BundleLauncherHelper.java >--- src/org/eclipse/pde/internal/ui/launcher/BundleLauncherHelper.java 18 Mar 2009 16:33:09 -0000 1.11 >+++ src/org/eclipse/pde/internal/ui/launcher/BundleLauncherHelper.java 10 Apr 2009 16:48:29 -0000 >@@ -32,15 +32,17 @@ > return getTargetBundleMap(configuration, null, IPDELauncherConstants.TARGET_BUNDLES); > } > >- public static Map getMergedBundleMap(ILaunchConfiguration configuration) throws CoreException { >+ public static Map getMergedBundleMap(ILaunchConfiguration configuration, boolean osgi) throws CoreException { > Set set = new HashSet(); >- Map map = getWorkspaceBundleMap(configuration, set, IPDELauncherConstants.WORKSPACE_BUNDLES); >- map.putAll(getTargetBundleMap(configuration, set, IPDELauncherConstants.TARGET_BUNDLES)); >+ String workspace = osgi == false ? IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS : IPDELauncherConstants.WORKSPACE_BUNDLES; >+ String target = osgi == false ? IPDELauncherConstants.SELECTED_TARGET_PLUGINS : IPDELauncherConstants.TARGET_BUNDLES; >+ Map map = getWorkspaceBundleMap(configuration, set, workspace); >+ map.putAll(getTargetBundleMap(configuration, set, target)); > return map; > } > >- public static IPluginModelBase[] getMergedBundles(ILaunchConfiguration configuration) throws CoreException { >- Map map = getMergedBundleMap(configuration); >+ public static IPluginModelBase[] getMergedBundles(ILaunchConfiguration configuration, boolean osgi) throws CoreException { >+ Map map = getMergedBundleMap(configuration, osgi); > return (IPluginModelBase[]) map.keySet().toArray(new IPluginModelBase[map.size()]); > } > >Index: src/org/eclipse/pde/internal/ui/launcher/LaunchConfigurationHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchConfigurationHelper.java,v >retrieving revision 1.45 >diff -u -r1.45 LaunchConfigurationHelper.java >--- src/org/eclipse/pde/internal/ui/launcher/LaunchConfigurationHelper.java 2 Feb 2009 19:21:21 -0000 1.45 >+++ src/org/eclipse/pde/internal/ui/launcher/LaunchConfigurationHelper.java 10 Apr 2009 16:48:29 -0000 >@@ -79,7 +79,7 @@ > return mgr.performStringSubstitution(text); > } > >- public static Properties createConfigIniFile(ILaunchConfiguration configuration, String productID, Map map, File directory) throws CoreException { >+ public static Properties createConfigIniFile(ILaunchConfiguration configuration, String productID, Map bundles, Map bundlesWithStartLevels, File directory) throws CoreException { > Properties properties = null; > // if we are to generate a config.ini, start with the values in the target platform's config.ini - bug 141918 > if (configuration.getAttribute(IPDELauncherConstants.CONFIG_GENERATE_DEFAULT, true)) { >@@ -93,7 +93,7 @@ > // if target's config.ini has the osgi.bundles header, then parse and compute the proper osgi.bundles value > String bundleList = properties.getProperty(PROP_OSGI_BUNDLES); > if (bundleList != null) >- properties.setProperty(PROP_OSGI_BUNDLES, computeOSGiBundles(TargetPlatformHelper.stripPathInformation(bundleList), map)); >+ properties.setProperty(PROP_OSGI_BUNDLES, computeOSGiBundles(TargetPlatformHelper.stripPathInformation(bundleList), bundles)); > } else { > String templateLoc = configuration.getAttribute(IPDELauncherConstants.CONFIG_TEMPLATE_LOCATION, (String) null); > if (templateLoc != null) { >@@ -106,7 +106,7 @@ > } > // whether we create a new config.ini or read from one as a template, we should add the required properties - bug 161265 > if (properties != null) { >- addRequiredProperties(properties, productID, map); >+ addRequiredProperties(properties, productID, bundles); > } else { > properties = new Properties(); > } >@@ -119,44 +119,26 @@ > boolean autostart = configuration.getAttribute(IPDELauncherConstants.DEFAULT_AUTO_START, false); > > // if we are launching using P2, write out P2 files (bundles.txt) and add P2 property to config.ini >- if (osgiBundles != null && osgiBundles.indexOf(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR) != -1 && map.containsKey(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR)) { >- >- // TODO we need to clean this up... our original list should have start level information >- // this causes a performance impact >+ if (osgiBundles != null && osgiBundles.indexOf(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR) != -1 && bundles.containsKey(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR)) { > URL bundlesTxt = null; > boolean usedefault = configuration.getAttribute(IPDELauncherConstants.USE_DEFAULT, true); > boolean useFeatures = configuration.getAttribute(IPDELauncherConstants.USEFEATURES, false); > if (usedefault || useFeatures) { >- bundlesTxt = P2Utils.writeBundlesTxt(map.values(), osgiBundles, directory); >+ bundlesTxt = P2Utils.writeBundlesTxt(bundlesWithStartLevels, 4, false, directory, osgiBundles); > } else { >- Map models = new HashMap(); >- Map modelsWithStartLevels = new HashMap(); >- modelsWithStartLevels.putAll(BundleLauncherHelper.getTargetBundleMap(configuration, Collections.EMPTY_SET, IPDELauncherConstants.SELECTED_TARGET_PLUGINS)); >- boolean automaticAdd = configuration.getAttribute(IPDELauncherConstants.AUTOMATIC_ADD, true); >- String attribute = automaticAdd ? IPDELauncherConstants.DESELECTED_WORKSPACE_PLUGINS : IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS; >- modelsWithStartLevels.putAll(BundleLauncherHelper.getWorkspaceBundleMap(configuration, null, attribute)); >- IPluginModelBase[] plugins = (IPluginModelBase[]) map.values().toArray(new IPluginModelBase[map.size()]); >- for (int i = 0; i < plugins.length; i++) { >- IPluginModelBase model = plugins[i]; >- String startLevel = (String) modelsWithStartLevels.get(model); >- if (startLevel != null) { >- models.put(model, startLevel); >- } >- } >- bundlesTxt = P2Utils.writeBundlesTxt(models, start, autostart, directory); >+ bundlesTxt = P2Utils.writeBundlesTxt(bundlesWithStartLevels, start, autostart, directory, null); > } > > if (bundlesTxt != null) { > properties.setProperty("org.eclipse.equinox.simpleconfigurator.configUrl", bundlesTxt.toString()); //$NON-NLS-1$ >- > // if we have simple configurator and update configurator together, ensure update doesn't reconcile >- if (map.get(IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR) != null) { >+ if (bundles.get(IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR) != null) { > properties.setProperty("org.eclipse.update.reconcile", "false"); //$NON-NLS-1$ //$NON-NLS-2$ > } > } > } > >- setBundleLocations(map, properties); >+ setBundleLocations(bundles, properties); > > save(new File(directory, "config.ini"), properties); //$NON-NLS-1$ > return properties; >Index: src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java,v >retrieving revision 1.35 >diff -u -r1.35 EquinoxLaunchConfiguration.java >--- src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java 7 Dec 2008 00:00:21 -0000 1.35 >+++ src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java 10 Apr 2009 16:48:30 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * EclipseSource Corporation - ongoing enhancements > *******************************************************************************/ > package org.eclipse.pde.ui.launcher; > >@@ -74,7 +75,7 @@ > String bundles = null; > if (fAllBundles.containsKey(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR)) { > // If simple configurator is being used, we need to write out the bundles.txt instead of writing out the list in the config.ini >- URL bundlesTxt = P2Utils.writeBundlesTxt(fModels, start, autostart, getConfigDir(configuration)); >+ URL bundlesTxt = P2Utils.writeBundlesTxt(fModels, start, autostart, getConfigDir(configuration), null); > if (bundlesTxt != null) { > properties.setProperty("org.eclipse.equinox.simpleconfigurator.configUrl", bundlesTxt.toString()); //$NON-NLS-1$ > if (fAllBundles.get(IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR) != null) { >@@ -153,7 +154,7 @@ > * @see org.eclipse.pde.ui.launcher.AbstractPDELaunchConfiguration#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) > */ > protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException { >- fModels = BundleLauncherHelper.getMergedBundleMap(configuration); >+ fModels = BundleLauncherHelper.getMergedBundleMap(configuration, true); > fAllBundles = new HashMap(fModels.size()); > Iterator iter = fModels.keySet().iterator(); > while (iter.hasNext()) { >Index: src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java,v >retrieving revision 1.33 >diff -u -r1.33 EclipseApplicationLaunchConfiguration.java >--- src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java 18 Mar 2009 20:52:44 -0000 1.33 >+++ src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java 10 Apr 2009 16:48:30 -0000 >@@ -37,6 +37,13 @@ > */ > public class EclipseApplicationLaunchConfiguration extends AbstractPDELaunchConfiguration { > >+ // used to generate the dev classpath entries >+ // key is bundle ID, value is a model >+ private Map fAllBundles; >+ >+ // key is a model, value is startLevel:autoStart >+ private Map fModels; >+ > /** > * To avoid duplicating variable substitution (and duplicate prompts) > * this variable will store the substituted workspace location. >@@ -76,9 +83,6 @@ > } > > boolean showSplash = true; >- // TODO fix getPluginstoRun to return a map that is model/startlevel >- // model after EquinoxLaunchConfiguration >- Map pluginMap = LaunchPluginValidator.getPluginsToRun(configuration); > if (configuration.getAttribute(IPDELauncherConstants.USEFEATURES, false)) { > validateFeatures(); > IPath installPath = PDEPlugin.getWorkspace().getRoot().getLocation(); >@@ -94,21 +98,21 @@ > programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigDir(configuration).toString() + "/dev.properties", true)); //$NON-NLS-1$ > } else { > String productID = LaunchConfigurationHelper.getProductID(configuration); >- Properties prop = LaunchConfigurationHelper.createConfigIniFile(configuration, productID, pluginMap, getConfigDir(configuration)); >+ Properties prop = LaunchConfigurationHelper.createConfigIniFile(configuration, productID, fAllBundles, fModels, getConfigDir(configuration)); > showSplash = prop.containsKey("osgi.splashPath") || prop.containsKey("splashLocation"); //$NON-NLS-1$ //$NON-NLS-2$ > String brandingId = LaunchConfigurationHelper.getContributingPlugin(productID); >- TargetPlatform.createPlatformConfiguration(getConfigDir(configuration), (IPluginModelBase[]) pluginMap.values().toArray(new IPluginModelBase[pluginMap.size()]), brandingId != null ? (IPluginModelBase) pluginMap.get(brandingId) : null); >- TargetPlatformHelper.checkPluginPropertiesConsistency(pluginMap, getConfigDir(configuration)); >+ TargetPlatform.createPlatformConfiguration(getConfigDir(configuration), (IPluginModelBase[]) fAllBundles.values().toArray(new IPluginModelBase[fAllBundles.size()]), brandingId != null ? (IPluginModelBase) fAllBundles.get(brandingId) : null); >+ TargetPlatformHelper.checkPluginPropertiesConsistency(fAllBundles, getConfigDir(configuration)); > programArgs.add("-configuration"); //$NON-NLS-1$ > programArgs.add("file:" + new Path(getConfigDir(configuration).getPath()).addTrailingSeparator().toString()); //$NON-NLS-1$ > > // add the output folder names > programArgs.add("-dev"); //$NON-NLS-1$ >- programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigDir(configuration).toString() + "/dev.properties", pluginMap)); //$NON-NLS-1$ >+ programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigDir(configuration).toString() + "/dev.properties", fAllBundles)); //$NON-NLS-1$ > } > // necessary for PDE to know how to load plugins when target platform = host platform > // see PluginPathFinder.getPluginPaths() and PluginPathFinder.isDevLaunchMode() >- IPluginModelBase base = (IPluginModelBase) pluginMap.get(PDECore.PLUGIN_ID); >+ IPluginModelBase base = (IPluginModelBase) fAllBundles.get(PDECore.PLUGIN_ID); > if (base != null && VersionUtil.compareMacroMinorMicro(base.getBundleDescription().getVersion(), new Version("3.3.1")) < 0) //$NON-NLS-1$ > programArgs.add("-pdelaunch"); //$NON-NLS-1$ > >@@ -238,6 +242,13 @@ > */ > protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException { > fWorkspaceLocation = null; >+ fModels = BundleLauncherHelper.getMergedBundleMap(configuration, false); >+ fAllBundles = new HashMap(fModels.size()); >+ Iterator iter = fModels.keySet().iterator(); >+ while (iter.hasNext()) { >+ IPluginModelBase model = (IPluginModelBase) iter.next(); >+ fAllBundles.put(model.getPluginBase().getId(), model); >+ } > validateConfigIni(configuration); > super.preLaunchCheck(configuration, launch, monitor); > } >@@ -263,7 +274,7 @@ > */ > public String[] getVMArguments(ILaunchConfiguration configuration) throws CoreException { > String[] vmArgs = super.getVMArguments(configuration); >- IPluginModelBase base = (IPluginModelBase) LaunchPluginValidator.getPluginsToRun(configuration).get(PDECore.PLUGIN_ID); >+ IPluginModelBase base = (IPluginModelBase) fAllBundles.get(PDECore.PLUGIN_ID); > if (base != null && VersionUtil.compareMacroMinorMicro(base.getBundleDescription().getVersion(), new Version("3.3.1")) >= 0) { //$NON-NLS-1$ > // necessary for PDE to know how to load plugins when target platform = host platform > // see PluginPathFinder.getPluginPaths() and PluginPathFinder.isDevLaunchMode() >Index: src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java,v >retrieving revision 1.29 >diff -u -r1.29 JUnitLaunchConfigurationDelegate.java >--- src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java 7 Jan 2009 19:54:56 -0000 1.29 >+++ src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java 10 Apr 2009 16:48:30 -0000 >@@ -7,15 +7,14 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >- * Code 9 Corporation - ongoing enhancements >+ * EclipseSource Corporation - ongoing enhancements > * David Saff <saff@mit.edu> - bug 102632 > * Ketan Padegaonkar <KetanPadegaonkar@gmail.com> - bug 250340 > *******************************************************************************/ > package org.eclipse.pde.ui.launcher; > > import java.io.File; >-import java.util.List; >-import java.util.Map; >+import java.util.*; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.*; > import org.eclipse.debug.core.*; >@@ -47,7 +46,12 @@ > > protected File fConfigDir = null; > >- private Map fPluginMap; >+ // used to generate the dev classpath entries >+ // key is bundle ID, value is a model >+ private Map fAllBundles; >+ >+ // key is a model, value is startLevel:autoStart >+ private Map fModels; > > /* > * (non-Javadoc) >@@ -123,17 +127,17 @@ > > // Create the platform configuration for the runtime workbench > String productID = LaunchConfigurationHelper.getProductID(configuration); >- LaunchConfigurationHelper.createConfigIniFile(configuration, productID, fPluginMap, getConfigurationDirectory(configuration)); >+ LaunchConfigurationHelper.createConfigIniFile(configuration, productID, fAllBundles, fModels, getConfigurationDirectory(configuration)); > String brandingId = LaunchConfigurationHelper.getContributingPlugin(productID); >- TargetPlatform.createPlatformConfiguration(getConfigurationDirectory(configuration), (IPluginModelBase[]) fPluginMap.values().toArray(new IPluginModelBase[fPluginMap.size()]), brandingId != null ? (IPluginModelBase) fPluginMap.get(brandingId) : null); >- TargetPlatformHelper.checkPluginPropertiesConsistency(fPluginMap, getConfigurationDirectory(configuration)); >+ TargetPlatform.createPlatformConfiguration(getConfigurationDirectory(configuration), (IPluginModelBase[]) fAllBundles.values().toArray(new IPluginModelBase[fAllBundles.size()]), brandingId != null ? (IPluginModelBase) fAllBundles.get(brandingId) : null); >+ TargetPlatformHelper.checkPluginPropertiesConsistency(fAllBundles, getConfigurationDirectory(configuration)); > > programArgs.add("-configuration"); //$NON-NLS-1$ > programArgs.add("file:" + new Path(getConfigurationDirectory(configuration).getPath()).addTrailingSeparator().toString()); //$NON-NLS-1$ > > // Specify the output folder names > programArgs.add("-dev"); //$NON-NLS-1$ >- programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigurationDirectory(configuration).toString() + "/dev.properties", fPluginMap)); //$NON-NLS-1$ >+ programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigurationDirectory(configuration).toString() + "/dev.properties", fAllBundles)); //$NON-NLS-1$ > > // necessary for PDE to know how to load plugins when target platform = host platform > // see PluginPathFinder.getPluginPaths() >@@ -207,7 +211,7 @@ > // if application is not set, we should launch the default UI test app > // Check to see if we should launch the legacy UI app > if (application == null) { >- IPluginModelBase model = (IPluginModelBase) fPluginMap.get("org.eclipse.pde.junit.runtime"); //$NON-NLS-1$ >+ IPluginModelBase model = (IPluginModelBase) fAllBundles.get("org.eclipse.pde.junit.runtime"); //$NON-NLS-1$ > BundleDescription desc = model != null ? model.getBundleDescription() : null; > if (desc != null) { > Version version = desc.getVersion(); >@@ -252,14 +256,12 @@ > String vmArgs = LaunchArgumentsHelper.getUserVMArguments(configuration); > > // necessary for PDE to know how to load plugins when target platform = host platform >- // see PluginPathFinder.getPluginPaths() and PluginPathFinder.isDevLaunchMode() >- Map pluginsToRun = LaunchPluginValidator.getPluginsToRun(configuration); >- IPluginModelBase base = (IPluginModelBase) pluginsToRun.get(PDECore.PLUGIN_ID); >+ IPluginModelBase base = (IPluginModelBase) fAllBundles.get(PDECore.PLUGIN_ID); > if (base != null && VersionUtil.compareMacroMinorMicro(base.getBundleDescription().getVersion(), new Version("3.3.1")) >= 0) { //$NON-NLS-1$ > vmArgs = concatArg(vmArgs, "-Declipse.pde.launch=true"); //$NON-NLS-1$ > } > // For p2 target, add "-Declipse.p2.data.area=@config.dir/p2" unless already specified by user >- if (pluginsToRun.containsKey("org.eclipse.equinox.p2.core")) { //$NON-NLS-1$ >+ if (fAllBundles.containsKey("org.eclipse.equinox.p2.core")) { //$NON-NLS-1$ > if (vmArgs.indexOf("-Declipse.p2.data.area=") < 0) { //$NON-NLS-1$ > vmArgs = concatArg(vmArgs, "-Declipse.p2.data.area=@config.dir" + File.separator + "p2"); //$NON-NLS-1$ //$NON-NLS-2$ > } >@@ -381,17 +383,23 @@ > * @see org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) > */ > protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException { >- // Get the list of plug-ins to run >- fPluginMap = LaunchPluginValidator.getPluginsToRun(configuration); >- > fWorkspaceLocation = null; >+ fModels = BundleLauncherHelper.getMergedBundleMap(configuration, false); >+ fAllBundles = new HashMap(fModels.size()); >+ Iterator iter = fModels.keySet().iterator(); >+ while (iter.hasNext()) { >+ IPluginModelBase model = (IPluginModelBase) iter.next(); >+ fAllBundles.put(model.getPluginBase().getId(), model); >+ } > > // implicitly add the plug-ins required for JUnit testing if necessary > String[] requiredPlugins = getRequiredPlugins(configuration); > for (int i = 0; i < requiredPlugins.length; i++) { > String id = requiredPlugins[i]; >- if (!fPluginMap.containsKey(id)) { >- fPluginMap.put(id, findPlugin(id)); >+ if (!fAllBundles.containsKey(id)) { >+ IPluginModelBase model = findPlugin(id); >+ fAllBundles.put(id, model); >+ fModels.put(model, "default:default"); //$NON-NLS-1$ > } > } > >Index: src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java,v >retrieving revision 1.4 >diff -u -r1.4 CreateFeatureProjectFromLaunchOperation.java >--- src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java 30 Jul 2008 21:25:34 -0000 1.4 >+++ src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java 10 Apr 2009 16:48:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2008 IBM Corporation and others. >+ * Copyright (c) 2007, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * EclipseSource Corporation - ongoing enhancements > *******************************************************************************/ > > package org.eclipse.pde.internal.ui.wizards.feature; >@@ -21,7 +22,6 @@ > import org.eclipse.pde.internal.core.feature.WorkspaceFeatureModel; > import org.eclipse.pde.internal.core.ifeature.IFeature; > import org.eclipse.pde.internal.ui.launcher.BundleLauncherHelper; >-import org.eclipse.pde.internal.ui.launcher.LaunchPluginValidator; > import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut; > import org.eclipse.pde.ui.launcher.IPDELauncherConstants; > import org.eclipse.swt.widgets.Shell; >@@ -47,10 +47,10 @@ > String id = type.getIdentifier(); > // if it is an Eclipse launch > if (id.equals(EclipseLaunchShortcut.CONFIGURATION_TYPE)) >- models = LaunchPluginValidator.getPluginList(fLaunchConfig); >+ models = BundleLauncherHelper.getMergedBundles(fLaunchConfig, false); > // else if it is an OSGi launch > else if (id.equals(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE)) >- models = BundleLauncherHelper.getMergedBundles(fLaunchConfig); >+ models = BundleLauncherHelper.getMergedBundles(fLaunchConfig, true); > } catch (CoreException e) { > } > IPluginBase[] result = new IPluginBase[models == null ? 0 : models.length];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 269111
:
129291
| 131513 |
131648
|
131649