aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-12-28 05:09:42 -0500
committerAlexander Kurtakov2017-12-28 05:09:42 -0500
commitfe66d24b3775198fe09118ca6ac5d89d2d5a638f (patch)
tree0ab616522bd665e7cf649b436ebb8b2481d53263
parentf870b0cd7d29e8cb496fd401c4ebb15b2f1be3fa (diff)
downloadeclipse.pde.build-fe66d24b3775198fe09118ca6ac5d89d2d5a638f.tar.gz
eclipse.pde.build-fe66d24b3775198fe09118ca6ac5d89d2d5a638f.tar.xz
eclipse.pde.build-fe66d24b3775198fe09118ca6ac5d89d2d5a638f.zip
Bug 529268 - Stop trying to acquire PluginConverter
This cleanups the generated build files from having multipe: [eclipse.buildScript] The service Plugin converter could not be acquired. Change-Id: I4dc768a4112ae8e3a389eaf1e941d42e97e80974 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java46
1 files changed, 2 insertions, 44 deletions
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
index 9f2d4f1a..4b62d71f 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java
@@ -16,8 +16,6 @@ import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.eclipse.core.runtime.*;
-import org.eclipse.osgi.service.pluginconversion.PluginConversionException;
-import org.eclipse.osgi.service.pluginconversion.PluginConverter;
import org.eclipse.osgi.service.resolver.*;
import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.osgi.util.ManifestElement;
@@ -81,10 +79,6 @@ public class PDEState implements IPDEBuildConstants, IBuildPropertiesConstants {
return state.addBundle(toAdd);
}
- private PluginConverter acquirePluginConverter() throws Exception {
- return BundleHelper.getDefault().acquireService(PluginConverter.class);
- }
-
//Add a bundle to the state, updating the version number
public boolean addBundle(Dictionary<String, String> enhancedManifest, File bundleLocation) {
String oldVersion = updateVersionNumber(enhancedManifest);
@@ -300,7 +294,7 @@ public class PDEState implements IPDEBuildConstants, IBuildPropertiesConstants {
//It is not a manifest, but a plugin or a fragment
if (manifestStream == null)
- return convertPluginManifest(bundleLocation, true);
+ return null;
try {
Hashtable<String, String> result = new Hashtable<>();
@@ -329,18 +323,7 @@ public class PDEState implements IPDEBuildConstants, IBuildPropertiesConstants {
if (BundleHelper.getManifestHeader(initialManifest, Constants.BUNDLE_SYMBOLICNAME) != null)
return true;
- Dictionary<String, String> generatedManifest = convertPluginManifest(bundleLocation, false);
- if (generatedManifest == null)
- return false;
-
- //merge manifests. The values from the generated manifest are added to the initial one. Values from the initial one are not deleted
- Enumeration<String> enumeration = generatedManifest.keys();
- while (enumeration.hasMoreElements()) {
- String key = enumeration.nextElement();
- if (BundleHelper.getManifestHeader(initialManifest, key) == null)
- initialManifest.put(key, generatedManifest.get(key));
- }
- return true;
+ return false;
}
private void enforceClasspath(Dictionary<String, String> manifest) {
@@ -368,31 +351,6 @@ public class PDEState implements IPDEBuildConstants, IBuildPropertiesConstants {
return manifest;
}
- private Dictionary<String, String> convertPluginManifest(File bundleLocation, boolean logConversionException) {
- PluginConverter converter;
- try {
- converter = acquirePluginConverter();
- Dictionary<String, String> manifest = converter.convertManifest(bundleLocation, false, null, false, null);
- if (convertedManifests != null)
- convertedManifests.add(manifest);
- return manifest;
- } catch (PluginConversionException convertException) {
- if (bundleLocation.getName().equals(org.eclipse.pde.build.Constants.FEATURE_FILENAME_DESCRIPTOR))
- return null;
- if (!new File(bundleLocation, org.eclipse.pde.build.Constants.PLUGIN_FILENAME_DESCRIPTOR).exists() && !new File(bundleLocation, org.eclipse.pde.build.Constants.FRAGMENT_FILENAME_DESCRIPTOR).exists())
- return null;
- if (logConversionException) {
- IStatus status = new Status(IStatus.WARNING, PI_PDEBUILD, 0, NLS.bind(Messages.exception_errorConverting, bundleLocation.getAbsolutePath()), convertException);
- BundleHelper.getDefault().getLog().log(status);
- }
- return null;
- } catch (Exception serviceException) {
- IStatus status = new Status(IStatus.WARNING, PI_PDEBUILD, 0, NLS.bind(Messages.exception_cannotAcquireService, "Plugin converter"), serviceException); //$NON-NLS-1$
- BundleHelper.getDefault().getLog().log(status);
- return null;
- }
- }
-
public void addBundles(Collection<File> bundles) {
for (Iterator<File> iter = bundles.iterator(); iter.hasNext();) {
File bundle = iter.next();