Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Single-class plugin patch?
Single-class plugin patch? [message #543609] Wed, 30 June 2010 04:22 Go to next message
Mark A. Ziesemer is currently offline Mark A. ZiesemerFriend
Messages: 2
Registered: July 2009
Location: Appleton, WI
Junior Member
What is the best way to apply a feature/plugin patch? There is a patch on a bug that wasn't included in Helios - and all I really need to do is patch one class. I already have a patched project and a built .jar - I just don't know the best way to get it to work well with P2.

It looks like I had some success by creating a "Feature Patch" project (which adds a <requires/> with a child <import feature .../> with patch=true in the feature.xml), then including the patched plugin project under "Plug-ins" (which adds a <plugin .../> element.)

Is there a better way of doing this? If not, is exporting the Feature Patch project as "Deployable Features", then using the created folder as an Eclipse update site also the best way of getting Eclipse to recognize the patched plugin?

Finally, this results in an update site of over 1 MB, as it includes the entire feature / patched plugin. Is there a way to only include the single patched *.class file, such that it is used instead of the one in the original plugin? Ideally, the update site would then only need to be a few KB.

Thanks!
Re: Single-class plugin patch? [message #543780 is a reply to message #543609] Wed, 30 June 2010 14:01 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

That's the correct way to patch an eclipse install.

1) generate the plugin with a higher version (3.6.0 becomes 3.6.1, for
example)
2) create a feature patch to patch the feature that contains the
original plugin, and the feature patch refers to the new plugin.
3) create a p2 repo for the feature patch + new plugin.

That p2 repo can then be installed. I also believe that you can make
the feature patch optional in some way, so that when the service release
comes along p2 can update to the new version of the original feature and
leave your feature patch behind.

The only way to replace a single class from a plugin is if you provide a
fragment to the host plugin, and the host plugin allows it through
Bundle-ClassPath tricks. Very few plugins allow this kind of patching,
because the plugin has to have it set up in its MANIFEST before it is
deployed.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Trouble with proxy authentication with Linux
Next Topic:Eclipse on Ubuntu with OpenJDK hanging unless root
Goto Forum:
  


Current Time: Thu Apr 18 17:10:37 GMT 2024

Powered by FUDForum. Page generated in 0.01733 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top