Add support for fragments in the plugin sy

Project:JNode Core
Component:Code
Category:feature request
Priority:normal
Assigned:admin
Status:closed
Description

Add support for fragments in the plugin system.

A fragment is a jar file which resources will become part of a plugin, once loaded by the plugin manager.

A fragment can be used to store localized data, architecture specific data etc.

Use case

Sorry, I didn't get that yet.

Could you please supply a use case that shows which problems can now be solved with fragments that couldn't be solved with normal plugins yet? Wouldn't it also be possible to add multiple library tags to the plugin descriptor?

Does the handbook mention fragments, or will developers have to search for this issue to find this feature?

Sebastian

org.classpath.core and org.classpath.ext

I have now found an example of a fragment: the org.classpath.ext plugin is a fragment that is attached to the org.classpath.core plugin.

Just to understand when fragments should be used:
Why aren't the classes contained in org.classpath.ext contained in org.classpath.core?
Or why isn't org.classpath.ext a normal plugin that requires the org.classpath.core plugin?

Sebastian

Answer

org.classpath.ext is introduced to keep a lot of classpath classes out of the bootimage.

org.classpath.ext is part of the initjar (and will someday be located on disk).

It is not a normal plugin, because of the classloader. With this construction all plugins can access classes in org.classpath.ext, because these classes are reachable via org.classpath.core. If it was a normal plugin, all other plugins would need to refer to org.classpath in order to use the classes in there.

Ewout

Dependency Checker Task

Ok. I will also modify the dependency checker task to include support for fragments and will then submit it as a patch.

Sebastian

#1

Status:active» closed

You can now add fragments.

A fragment descriptor is just like a plugin descriptor, only it has a "fragment" roottag (instead of "plugin") and it requires two additional attributes on the root tag:

plugin-id The id of the plugin to which this fragment attaches.
plugin-version The version of the plugin to which this fragment attaches.

Ewout

#2