1 11 package org.eclipse.pde.internal.core.exports; 12 13 import java.io.File ; 14 import java.util.Dictionary ; 15 16 import org.eclipse.osgi.service.resolver.BundleDescription; 17 import org.eclipse.osgi.service.resolver.State; 18 import org.eclipse.pde.core.plugin.TargetPlatform; 19 import org.eclipse.pde.internal.core.TargetPlatformHelper; 20 21 public class PluginExportOperation extends FeatureBasedExportOperation { 22 23 public PluginExportOperation(FeatureExportInfo info) { 24 super(info); 25 } 26 27 protected void createPostProcessingFiles() { 28 createPostProcessingFile(new File (fFeatureLocation, PLUGIN_POST_PROCESSING)); 29 } 30 31 protected State getState(String os, String ws, String arch) { 32 if (os.equals(TargetPlatform.getOS()) 34 && ws.equals(TargetPlatform.getWS()) 35 && arch.equals(TargetPlatform.getOSArch()) 36 && fStateCopy != null) { 37 fStateCopy.resolve(true); 38 return fStateCopy; 39 } 40 return super.getState(os, ws, arch); 41 } 42 43 protected boolean shouldAddPlugin(BundleDescription bundle, 44 Dictionary environment) { 45 boolean conflict = !super.shouldAddPlugin(bundle, environment); 47 if (conflict) { 48 if (fStateCopy == null) 50 copyState(TargetPlatformHelper.getState()); 51 BundleDescription desc = fStateCopy.removeBundle(bundle.getBundleId()); 53 BundleDescription newDesc = fStateCopy.getFactory().createBundleDescription(desc.getBundleId(), desc.getSymbolicName(), 54 desc.getVersion(), desc.getLocation(), desc.getRequiredBundles(), desc.getHost(), desc.getImportPackages(), 55 desc.getExportPackages(), desc.isSingleton(), desc.attachFragments(), desc.dynamicFragments(), null, 56 desc.getExecutionEnvironments(), desc.getGenericRequires(), desc.getGenericCapabilities()); 57 fStateCopy.addBundle(newDesc); 58 } 59 return true; 61 } 62 63 } 64 | Popular Tags |