Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "JDT UI/Howto/Create Feature Patch"
< JDT UI
(Created page with "This page explains how you can create a feature patch that adds that fix for the most annoying bug ever to the otherwise perfect JDT UI plug-in. I'll just show how I've produ...") |
|||
Line 1: | Line 1: | ||
− | This page explains how you can create a feature patch | + | This page explains how you can create a feature patch. E.g. to add that fix for the most annoying bug ever to the otherwise perfect JDT UI plug-in. |
− | I'll just show how I've produced the output for {{bug|434941|17}}, a feature patch on top of 4.4.1 that patches the org.eclipse.jdt.ui plug-in in the org.eclipse.jdt feature. You can adapt the versions/bundles to your concrete use case. Note that patching multiple features is a bit more complicated, since you need to create multiple patch features that depend on each other. | + | I'll just show how I've produced the output for {{bug|434941|17}}, a feature patch on top of 4.4.1 that patches the org.eclipse.jdt.ui plug-in in the org.eclipse.jdt feature. You can adapt the versions/bundles to your concrete use case. Note that patching multiple features is a bit more complicated, since you need to create multiple patch features that depend on each other and mirror the dependencies between the original features. |
== Setup == | == Setup == | ||
− | * start with the Eclipse version you want to create a patch for (4.4.1 / M20140925-0400) | + | * start up with the Eclipse version you want to create a patch for (4.4.1 / M20140925-0400) |
− | * clone <code>git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui | + | * [[EGit/User_Guide#Cloning_a_Repository | clone]] <code>git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git</code> |
* import the projects you need to touch (org.eclipse.jdt.ui) | * import the projects you need to touch (org.eclipse.jdt.ui) | ||
* switch to the right branch (R4_4_maintenance) and make sure the patch is applied to your workspace | * switch to the right branch (R4_4_maintenance) and make sure the patch is applied to your workspace | ||
Line 24: | Line 24: | ||
* In the feature.xml editor, go to the '''Plug-ins''' tab and add the plug-in to patch (org.eclipse.jdt.ui) | * In the feature.xml editor, go to the '''Plug-ins''' tab and add the plug-in to patch (org.eclipse.jdt.ui) | ||
− | * fill out the rest of the forms. | + | * fill out the rest of the forms. |
− | <source lang="xml"> | + | {| class="wikitable mw-collapsible mw-collapsed" |
+ | |- | ||
+ | ! feature.xml for this example | ||
+ | |- | ||
+ | | <source lang="xml"> | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<feature | <feature | ||
Line 59: | Line 63: | ||
</feature> | </feature> | ||
− | </source> | + | </source> |
+ | |} | ||
* due to p2 {{bug|262009}}, you also have to create a New > Category Definition | * due to p2 {{bug|262009}}, you also have to create a New > Category Definition | ||
** save the category.xml file in your patch feature project | ** save the category.xml file in your patch feature project | ||
− | ** add a dummy category and add your new patch feature | + | ** add a dummy category and add your new patch feature |
− | <source lang="xml"> | + | {| class="wikitable mw-collapsible mw-collapsed" |
+ | |- | ||
+ | ! resulting category.xml | ||
+ | |- | ||
+ | | <source lang="xml"><source lang="xml"> | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<site> | <site> | ||
Line 76: | Line 85: | ||
</category-def> | </category-def> | ||
</site> | </site> | ||
− | </source> | + | </source> |
+ | |} | ||
== Build and export feature patch == | == Build and export feature patch == |
Revision as of 11:36, 17 October 2014
This page explains how you can create a feature patch. E.g. to add that fix for the most annoying bug ever to the otherwise perfect JDT UI plug-in.
I'll just show how I've produced the output for bug 434941 comment 17, a feature patch on top of 4.4.1 that patches the org.eclipse.jdt.ui plug-in in the org.eclipse.jdt feature. You can adapt the versions/bundles to your concrete use case. Note that patching multiple features is a bit more complicated, since you need to create multiple patch features that depend on each other and mirror the dependencies between the original features.
Contents
Setup
- start up with the Eclipse version you want to create a patch for (4.4.1 / M20140925-0400)
- clone
git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git
- import the projects you need to touch (org.eclipse.jdt.ui)
- switch to the right branch (R4_4_maintenance) and make sure the patch is applied to your workspace
Shortcut if you just want to patch your existing install
(Skip this section if you want to create a feature patch that others can use as well!)
- select the project and choose Export > Deployable plug-ins and fragments
- select the plug-in to export (org.eclipse.jdt.ui)
- select Destination > Install into host
- click Finish
- confirm messages, restart, and enjoy
Create patch feature
- create New > Other... > Feature Patch
- give the project a unique name (org.eclipse.jdt.ui.bug434941.sortmembers)
- click Browse and select the feature that contains the plug-in (org.eclipse.jdt)
- click Finish
- In the feature.xml editor, go to the Plug-ins tab and add the plug-in to patch (org.eclipse.jdt.ui)
- fill out the rest of the forms.
feature.xml for this example |
---|
<?xml version="1.0" encoding="UTF-8"?> <feature id="org.eclipse.jdt.ui.bug434941.sortmembers" label="Sort Members patch for bug 434941" version="1.0.0" provider-name="Eclipse.org"> <description> Sort Members patch for bug 434941 </description> <copyright> Copyright (c) 2014 IBM Corporation and others </copyright> <license url="http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0 http://www.eclipse.org/legal/epl-v10.html </license> <requires> <import feature="org.eclipse.jdt" version="3.10.0.v20140910-2310" patch="true"/> </requires> <plugin id="org.eclipse.jdt.ui" download-size="0" install-size="0" version="0.0.0" unpack="false"/> </feature> |
- due to p2 bug 262009, you also have to create a New > Category Definition
- save the category.xml file in your patch feature project
- add a dummy category and add your new patch feature
resulting category.xml |
---|
<source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <site> <feature url="features/org.eclipse.jdt.ui.bug434941.sortmembers_1.0.0.jar" id="org.eclipse.jdt.ui.bug434941.sortmembers" version="1.0.0" patch="true"> <category name="org.eclipse.jdt.ui.sortmembers.bug434941"/> </feature> <category-def name="org.eclipse.jdt.ui.sortmembers.bug434941" label="Dummy category for p2 bug 262009"> <description> Dummy; please vote for https://bugs.eclipse.org/bugs/show_bug.cgi?id=262009 . </description> </category-def> </site> |
Build and export feature patch
- open the feature.xml > Overview, and click Export Wizard, or open the "Deployable features" wizard under File > Export...
- make sure your feature is checked and specify an (empty) output directory
- switch to Options tab
- click the Browse button after Categorize repository and select your category.xml
- click Finish and go get a coffee
Publish
- when the export is done, publish the output directory on a website or put it into a ZIP for manual installs