0

I need to turn Eclipse fragments into plug-ins. Haven't found any wizard to support this.

So I've created a plugin.xml and edited the MANIFEST.MF to look exactly like a plug-in project does. Still, Eclipse somehow detects it's not a plug-in: for example it asks for a Host-plugin.

Also checked .project file, nothing seems to indicate "fragmentness".

Why I need this: Fragments were used for Unit-testing; but they're rather inconvenient: any modification in them triggers a chain of builds, and they block the exporting of individual plug-ins, unless their project is closed.

Solution As Greg suggested it was the 'Fragment-Host:' option that did the trick. And as Rüdiger wrote; the project had to be closed/reopened for eclipse to acknowledge the change.

Adam Horvath
  • 1,249
  • 1
  • 10
  • 25
  • Did you delete the `fragment.xml` file? – Rüdiger Herrmann May 11 '17 at 16:59
  • Interestingly there's none. The fragments only have a MANIFEST.MF in them. They're used for Unit-testing only. – Adam Horvath May 12 '17 at 08:12
  • 1
    I vaguely remember having done that in the past and removing the `Fragment-Host` directive was sufficient. Did you try to close/re-open or delete (without contents) and re-import the project into the workspace so that PDE is forced to refresh its internal for that project? – Rüdiger Herrmann May 12 '17 at 08:17
  • Out of curiosity, why do you convert your test-fragments into plugins? – Rüdiger Herrmann May 12 '17 at 08:20
  • Thank you for your help, I edited the question to contain the reason. – Adam Horvath May 12 '17 at 08:45
  • Regarding your motivation for this change: I haven't seen such problems with test fragments. Possibly the reason lies in the way the plug-ins and fragments are set up. [See here for a working example](https://github.com/rherrmann/eclipse-extras), including a test utility plug-in used by fragments. Not sure what 'block exporting individual plug-ins' means though. Feel free to open a separate question if you'd like to try to address the source of the problem. – Rüdiger Herrmann May 12 '17 at 11:41

1 Answers1

1

The fragment host is specified in the fragment's MANIFEST.MF:

Fragment-Host: host.plug.in

you will need to remove that.

However many fragments rely on code from their host plugin so it may not be possible to just convert the fragment.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • Fragments are used for Unit-testing; they seemed like a good idea for it. But as it turns out, any modification in them triggers a chain of builds, and they block the exporting of individual plug-ins, unless their project is closed. – Adam Horvath May 12 '17 at 08:22