Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 78588

Summary: Enhance PluginConverter API
Product: [Eclipse Project] Platform Reporter: Wassim Melhem <wassim.melhem>
Component: RuntimeAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pascal
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed solution
none
PDE patch none

Description Wassim Melhem CLA 2004-11-14 21:51:35 EST
In order to take some of the load off the runtime and the too-strong -clean 
when self-hosting, PDE needs to generate manifest.mf for workspace plugins 
that undergo changes undetected by the runtime (e.g. addition of new packages) 
from one launch to the next. (bug 75213)

The current API is not sufficient:
PluginConverter.convertManifest(File, boolean, String, boolean) is not 
sufficient for this scenario.  This is because the last arg (ie. analyzeJars) 
only works on JARs. 

We need to be able to make a call on the plugin converter that will behave as 
it would when the runtime starts up in dev mode.  That is, we need the plugin 
converter to also look at all output folders, not just JARs.
Comment 1 Pascal Rapicault CLA 2004-11-16 17:59:11 EST
The analyseJar option is badly named since the Converter is able to generate
manifests from the class files (this is how we run in self host mode).

To make this support fully works, we need to provide you a way to specify in
which folders the binary needs to be looked up since by default we are using the
dev classpath info of the running eclipse.

Although I don't see any problem in adding this support, I'm wondering why you
simply do not delete the manifest from the caches so runtime will only
regenerate this one.

Note as well that initially the "analyseJars" parameter has been introduced to
prevent require info generation so that PDE could easily generate them since it
has access to the java model. By curiosity, why is this not the model anymore?
Comment 2 Wassim Melhem CLA 2004-11-16 22:20:54 EST
"analyzeJARs" was introduced so that PDE does not pay the price of cracking 
all the JARs open when resolving the target platform since we don't need that 
information and it was an expensive operation.

When generating a manifest.mf for the runtime's use upon launching, it is 
better to use the runtime facilities and keep PDE out of the manifest 
generating business.  This, in fact, would be better from a runtime point of 
view as your code becomes heavily tested in the PDE-controlled environment. 

Deleting the manifest from the runtime cache never occurred to me.  It would 
actually be easier for PDE if we deleted it.  So if you want to do it that 
way, then fine by me.  This option also exercises the runtime code for 
generating manifests and leaves PDE out of it, which is a good thing.
Comment 3 Wassim Melhem CLA 2005-02-19 14:46:32 EST
The context for this request has changed but the functionality is still needed.

When converting a plugin to use a manifest.mf (as we help people migrate or 
generate a manifest.mf using the plugin editor), we want the plugin converter 
to go through the bin folder and generate the export-package header.

So an argument on the converter taking a dev.properties file or the like, 
telling you where to find the *.classes for this plugin, would be good.
Comment 4 Thomas Watson CLA 2005-02-28 17:47:31 EST
Created attachment 18372 [details]
Proposed solution

This patch addes a new param to convertManifest to pass a Dictionary of
development time classpaths mapping plugin ids -> a list of development paths.
Comment 5 Thomas Watson CLA 2005-02-28 17:49:11 EST
I will take ownership of the defect to release the patch.  Pascal, if you get 
a chance can you review the patch.
Comment 6 Wassim Melhem CLA 2005-02-28 17:51:13 EST
Just to make sure, you support absolute paths, right?
This would be required to accomodate cases where people use linked 
folders/libraries.
Comment 7 Thomas Watson CLA 2005-02-28 22:16:51 EST
Yes, it will support the same format as the properties file that is passed to 
the -dev argument of eclipse.  This allows you to specify absolute paths.
Comment 8 Thomas Watson CLA 2005-03-02 14:05:57 EST
I released the patch so Wassim can make progress this week.
Comment 9 Wassim Melhem CLA 2005-03-04 02:25:40 EST
This does not seem to be working.
You need the latest pde.core and pde.ui from HEAD that call the new API for 
this.

1. Create a hello world plugin WITHOUT a manifest.mf
It gets generated with a fully exported library.

2. From the runtime page of the editor, click on the link to create a 
manifest.mf.  I verified that the dictionary contains (com.example.xyz=bin), 
however, the resultant manifest.mf does not contain an Export-Package.
Comment 10 Thomas Watson CLA 2005-03-04 15:32:24 EST
Created attachment 18467 [details]
PDE patch

The PluginConverter API is expecting a File to the location of the plugin
project.  PDE is passing the location to the plugin.xml/fragment.xml in the
plugin project.  This patch is a fix to PDE.

One thing I noticed is that if auto-build is not set then the manifest will
still not contain any exports because the bin/ directory does not exist yet. 
Should PDE force a project build first?
Comment 11 Wassim Melhem CLA 2005-03-04 16:10:13 EST
verified that if you pass in the location of the plugin project itself, the 
manifest.mf is generated fully and correctly.

As for the autobuild-off scenario, I will force a build in that case.
Comment 12 Thomas Watson CLA 2005-03-04 16:22:59 EST
Closing as fixed per comment 11