diff options
| author | Julian Honnen | 2020-06-25 09:04:52 +0000 |
|---|---|---|
| committer | Julian Honnen | 2020-06-25 09:04:52 +0000 |
| commit | 9ef673b606075bc44d057e72094e53d741306b29 (patch) | |
| tree | 7950d262275e487887be57de92cf867fe68d875e | |
| parent | 990838276771a025e4a97986b006b507d4c76b30 (diff) | |
| download | eclipse.pde.ui-9ef673b606075bc44d057e72094e53d741306b29.tar.gz eclipse.pde.ui-9ef673b606075bc44d057e72094e53d741306b29.tar.xz eclipse.pde.ui-9ef673b606075bc44d057e72094e53d741306b29.zip | |
Bug 564567 - [launching] Remove remaining support for usefeaturesI20200628-1800I20200626-1800
Removed all remaining references since it's unsupported since 3.6
The deprecated EclipseApplicationLaunchConfiguration now always throws
an exception as all code paths are unsupported.
Change-Id: I3d5156a83de6bfb5bacc7fcbc2044b7373af0c69
Signed-off-by: Julian Honnen <julian.honnen@vector.com>
4 files changed, 4 insertions, 143 deletions
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java index a70b9df189..a5763fca9c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java @@ -362,7 +362,6 @@ public class LaunchAction extends Action { String computedName = getComputedName(new Path(fPath).lastSegment()); ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, computedName); wc.setAttribute(IPDELauncherConstants.LOCATION, LaunchArgumentsHelper.getDefaultWorkspaceLocation(computedName)); - wc.setAttribute(IPDELauncherConstants.USEFEATURES, false); wc.setAttribute(IPDELauncherConstants.USE_DEFAULT, false); wc.setAttribute(IPDELauncherConstants.DOCLEAR, false); wc.setAttribute(IPDEConstants.DOCLEARLOG, false); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java index 840d949767..e40c367ba2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseApplicationLaunchConfiguration.java @@ -22,13 +22,11 @@ import org.eclipse.core.variables.VariablesPlugin; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.pde.core.plugin.IPluginModelBase; -import org.eclipse.pde.core.plugin.TargetPlatform; -import org.eclipse.pde.internal.core.*; +import org.eclipse.pde.internal.core.PDECore; import org.eclipse.pde.internal.core.util.CoreUtility; import org.eclipse.pde.internal.core.util.VersionUtil; import org.eclipse.pde.internal.launching.PDEMessages; import org.eclipse.pde.internal.launching.launcher.*; -import org.eclipse.pde.internal.ui.PDEPlugin; import org.osgi.framework.Version; /** @@ -62,144 +60,13 @@ public class EclipseApplicationLaunchConfiguration extends AbstractPDELaunchConf @Override public String[] getProgramArguments(ILaunchConfiguration configuration) throws CoreException { - ArrayList<String> programArgs = new ArrayList<>(); - - // If a product is specified, then add it to the program args - if (configuration.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.USE_PRODUCT, false)) { - String product = configuration.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.PRODUCT, ""); //$NON-NLS-1$ - if (product.length() > 0) { - programArgs.add("-product"); //$NON-NLS-1$ - programArgs.add(product); - } else { // TODO product w/o an application and product... how to handle gracefully? - programArgs.add("-application"); //$NON-NLS-1$ - programArgs.add(configuration.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.APPLICATION, "")); //$NON-NLS-1$ - } - } else { - // specify the application to launch - programArgs.add("-application"); //$NON-NLS-1$ - programArgs.add(configuration.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.APPLICATION, TargetPlatform.getDefaultApplication())); - } - - // specify the workspace location for the runtime workbench - if (fWorkspaceLocation == null) { - fWorkspaceLocation = LaunchArgumentsHelper.getWorkspaceLocation(configuration); - } - if (fWorkspaceLocation.length() > 0) { - programArgs.add("-data"); //$NON-NLS-1$ - programArgs.add(fWorkspaceLocation); - } - - boolean showSplash = true; - if (configuration.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.USEFEATURES, false)) { - validateFeatures(); - IPath installPath = PDEPlugin.getWorkspace().getRoot().getLocation(); - programArgs.add("-install"); //$NON-NLS-1$ - programArgs.add("file:" + installPath.removeLastSegments(1).addTrailingSeparator().toString()); //$NON-NLS-1$ - if (!configuration.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, true)) { - programArgs.add("-configuration"); //$NON-NLS-1$ - programArgs.add("file:" + new Path(getConfigDir(configuration).getPath()).addTrailingSeparator().toString()); //$NON-NLS-1$ - } - programArgs.add("-update"); //$NON-NLS-1$ - // add the output folder names - programArgs.add("-dev"); //$NON-NLS-1$ - programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigDir(configuration).toString() + "/dev.properties", true)); //$NON-NLS-1$ - } else { - - throw new CoreException(LauncherUtils.createErrorStatus(PDEMessages.PDE_updateManagerNotSupported)); - } - // necessary for PDE to know how to load plugins when target platform = host platform - // see PluginPathFinder.getPluginPaths() and PluginPathFinder.isDevLaunchMode() - IPluginModelBase base = 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$ - - String[] args = super.getProgramArguments(configuration); - Collections.addAll(programArgs, args); - - if (!programArgs.contains("-nosplash") && showSplash) { //$NON-NLS-1$ - if (TargetPlatformHelper.getTargetVersion() >= 3.1) { - programArgs.add(0, "-launcher"); //$NON-NLS-1$ - - IPath path = null; - if (TargetPlatform.getOS().equals("macosx")) { //$NON-NLS-1$ - path = new Path(TargetPlatform.getLocation()).append("Eclipse.app/Contents/MacOS/eclipse"); //$NON-NLS-1$ - } else { - path = new Path(TargetPlatform.getLocation()).append("eclipse"); //$NON-NLS-1$ - if (TargetPlatform.getOS().equals("win32")) { //$NON-NLS-1$ - path = path.addFileExtension("exe"); //$NON-NLS-1$ - } - } - - programArgs.add(1, path.toOSString()); //This could be the branded launcher if we want (also this does not bring much) - programArgs.add(2, "-name"); //$NON-NLS-1$ - programArgs.add(3, "Eclipse"); //This should be the name of the product //$NON-NLS-1$ - programArgs.add(4, "-showsplash"); //$NON-NLS-1$ - programArgs.add(5, "600"); //$NON-NLS-1$ - } else { - programArgs.add(0, "-showsplash"); //$NON-NLS-1$ - programArgs.add(1, computeShowsplashArgument()); - } - } - return programArgs.toArray(new String[programArgs.size()]); - } - - private void validateFeatures() throws CoreException { - IPath installPath = PDEPlugin.getWorkspace().getRoot().getLocation(); - String lastSegment = installPath.lastSegment(); - boolean badStructure = lastSegment == null; - if (!badStructure) { - IPath featuresPath = installPath.removeLastSegments(1).append("features"); //$NON-NLS-1$ - badStructure = !lastSegment.equalsIgnoreCase("plugins") //$NON-NLS-1$ - || !featuresPath.toFile().exists(); - } - if (badStructure) { - throw new CoreException(LauncherUtils.createErrorStatus(PDEMessages.WorkbenchLauncherConfigurationDelegate_badFeatureSetup)); - } - // Ensure important files are present - ensureProductFilesExist(getProductPath()); - } - - private IPath getProductPath() { - return PDEPlugin.getWorkspace().getRoot().getLocation().removeLastSegments(1); - } - - private String computeShowsplashArgument() { - IPath eclipseHome = new Path(TargetPlatform.getLocation()); - IPath fullPath = eclipseHome.append("eclipse"); //$NON-NLS-1$ - return fullPath.toOSString() + " -showsplash 600"; //$NON-NLS-1$ - } - - private void ensureProductFilesExist(IPath productArea) { - File productDir = productArea.toFile(); - File marker = new File(productDir, ".eclipseproduct"); //$NON-NLS-1$ - IPath eclipsePath = new Path(TargetPlatform.getLocation()); - if (!marker.exists()) - CoreUtility.copyFile(eclipsePath, ".eclipseproduct", marker); //$NON-NLS-1$ - - File configDir = new File(productDir, "configuration"); //$NON-NLS-1$ - if (!configDir.exists()) - configDir.mkdirs(); - File ini = new File(configDir, "config.ini"); //$NON-NLS-1$ - if (!ini.exists()) - CoreUtility.copyFile(eclipsePath.append("configuration"), "config.ini", ini); //$NON-NLS-1$ //$NON-NLS-2$ + throw new CoreException(LauncherUtils.createErrorStatus(PDEMessages.PDE_updateManagerNotSupported)); } @Override protected File getConfigDir(ILaunchConfiguration config) { if (fConfigDir == null) { - try { - if (config.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.USEFEATURES, false) && config.getAttribute(org.eclipse.pde.launching.IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, true)) { - String root = getProductPath().toString(); - root += "/configuration"; //$NON-NLS-1$ - fConfigDir = new File(root); - if (!fConfigDir.exists()) - fConfigDir.mkdirs(); - } else { - fConfigDir = LaunchConfigurationHelper.getConfigurationArea(config); - } - } catch (CoreException e) { - fConfigDir = LaunchConfigurationHelper.getConfigurationArea(config); - } + fConfigDir = LaunchConfigurationHelper.getConfigurationArea(config); } return fConfigDir; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java index 8f855b0953..c21f58f168 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java @@ -225,7 +225,6 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { wc.setAttribute(IPDELauncherConstants.LOCATION, LaunchArgumentsHelper.getDefaultWorkspaceLocation(wc.getName())); initializeProgramArguments(wc); initializeVMArguments(wc); - wc.setAttribute(IPDELauncherConstants.USEFEATURES, false); wc.setAttribute(IPDELauncherConstants.DOCLEAR, false); wc.setAttribute(IPDELauncherConstants.ASKCLEAR, true); wc.setAttribute(IPDEConstants.APPEND_ARGS_EXPLICITLY, true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java index 3edd3ace06..a86920a812 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java @@ -147,9 +147,7 @@ public class PluginsTab extends AbstractLauncherTab { public void initializeFrom(ILaunchConfiguration configuration) { try { int index = DEFAULT_SELECTION; - if (configuration.getAttribute(IPDELauncherConstants.USEFEATURES, false)) { - index = FEATURE_SELECTION; - } else if (configuration.getAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, false)) { + if (configuration.getAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, false)) { index = FEATURE_SELECTION; } else if (!configuration.getAttribute(IPDELauncherConstants.USE_DEFAULT, true)) { index = PLUGIN_SELECTION; @@ -170,8 +168,6 @@ public class PluginsTab extends AbstractLauncherTab { @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute(IPDELauncherConstants.USE_DEFAULT, true); - // The use features option was removed in 3.6 - configuration.removeAttribute(IPDELauncherConstants.USEFEATURES); configuration.setAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, false); fBlock.setDefaults(configuration); } |
