|
Lines 28-39
Link Here
|
| 28 |
import org.eclipse.pde.core.build.IBuildEntry; |
28 |
import org.eclipse.pde.core.build.IBuildEntry; |
| 29 |
import org.eclipse.pde.core.plugin.IPluginBase; |
29 |
import org.eclipse.pde.core.plugin.IPluginBase; |
| 30 |
import org.eclipse.pde.core.plugin.IPluginLibrary; |
30 |
import org.eclipse.pde.core.plugin.IPluginLibrary; |
|
|
31 |
import org.eclipse.pde.core.plugin.IPluginManifestInfo; |
| 31 |
import org.eclipse.pde.core.plugin.IPluginModelFactory; |
32 |
import org.eclipse.pde.core.plugin.IPluginModelFactory; |
| 32 |
import org.eclipse.pde.internal.core.ICoreConstants; |
33 |
import org.eclipse.pde.internal.core.ICoreConstants; |
| 33 |
import org.eclipse.pde.internal.core.TargetPlatformHelper; |
34 |
import org.eclipse.pde.internal.core.TargetPlatformHelper; |
| 34 |
import org.eclipse.pde.internal.core.build.WorkspaceBuildModel; |
35 |
import org.eclipse.pde.internal.core.build.WorkspaceBuildModel; |
| 35 |
import org.eclipse.pde.internal.core.bundle.WorkspaceBundlePluginModel; |
36 |
import org.eclipse.pde.internal.core.bundle.WorkspaceBundlePluginModel; |
| 36 |
import org.eclipse.pde.internal.core.ibundle.IBundle; |
|
|
| 37 |
import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; |
37 |
import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; |
| 38 |
import org.eclipse.pde.internal.core.natures.PDE; |
38 |
import org.eclipse.pde.internal.core.natures.PDE; |
| 39 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
39 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
|
Lines 236-249
Link Here
|
| 236 |
|
236 |
|
| 237 |
private void createManifestFile(IFile file, IProgressMonitor monitor) |
237 |
private void createManifestFile(IFile file, IProgressMonitor monitor) |
| 238 |
throws CoreException { |
238 |
throws CoreException { |
| 239 |
WorkspaceBundlePluginModel model = new WorkspaceBundlePluginModel(file, |
239 |
WorkspaceBundlePluginModel model; |
| 240 |
null); |
240 |
model = new WorkspaceBundlePluginModel(file, null); |
| 241 |
model.load(); |
241 |
model.load(); |
| 242 |
IBundle pluginBundle = model.getBundleModel().getBundle(); |
|
|
| 243 |
|
242 |
|
| 244 |
String pluginId = pluginBundle.getHeader(Constants.BUNDLE_SYMBOLICNAME); |
243 |
IPluginManifestInfo manifestInfo = model.getPluginManifestInfo(); |
| 245 |
String pluginName = pluginBundle.getHeader(Constants.BUNDLE_NAME); |
244 |
|
| 246 |
String pluginVersion = pluginBundle.getHeader(Constants.BUNDLE_VERSION); |
245 |
String pluginId = manifestInfo.getHeader(Constants.BUNDLE_SYMBOLICNAME); |
|
|
246 |
String pluginName = manifestInfo.getHeader(Constants.BUNDLE_NAME); |
| 247 |
String pluginVersion = manifestInfo.getHeader(Constants.BUNDLE_VERSION); |
| 247 |
|
248 |
|
| 248 |
boolean missingInfo = (pluginId == null || pluginName == null || pluginVersion == null); |
249 |
boolean missingInfo = (pluginId == null || pluginName == null || pluginVersion == null); |
| 249 |
|
250 |
|
|
Lines 263-271
Link Here
|
| 263 |
pluginName = createInitialName(pluginId); |
264 |
pluginName = createInitialName(pluginId); |
| 264 |
} |
265 |
} |
| 265 |
|
266 |
|
| 266 |
pluginBundle.setHeader(Constants.BUNDLE_SYMBOLICNAME, pluginId); |
267 |
manifestInfo.setHeader(Constants.BUNDLE_SYMBOLICNAME, pluginId); |
| 267 |
pluginBundle.setHeader(Constants.BUNDLE_VERSION, pluginVersion); |
268 |
manifestInfo.setHeader(Constants.BUNDLE_VERSION, pluginVersion); |
| 268 |
pluginBundle.setHeader(Constants.BUNDLE_NAME, pluginName); |
269 |
manifestInfo.setHeader(Constants.BUNDLE_NAME, pluginName); |
| 269 |
|
270 |
|
| 270 |
if (missingInfo) { |
271 |
if (missingInfo) { |
| 271 |
IPluginModelFactory factory = model.getPluginFactory(); |
272 |
IPluginModelFactory factory = model.getPluginFactory(); |
|
Lines 283-289
Link Here
|
| 283 |
base.add(library); |
284 |
base.add(library); |
| 284 |
} |
285 |
} |
| 285 |
if (TargetPlatformHelper.getTargetVersion() >= 3.1) |
286 |
if (TargetPlatformHelper.getTargetVersion() >= 3.1) |
| 286 |
pluginBundle.setHeader(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$ |
287 |
manifestInfo.setHeader(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$ |
| 287 |
} |
288 |
} |
| 288 |
|
289 |
|
| 289 |
model.save(); |
290 |
model.save(); |