Sunday, July 24, 2011

PDE Good Practices: #8 Set correct EE and Java compliance levels

The Execution Environment that is set on the plug-in manifest governs the lowest JRE version the plug-in can work with. If the OSGi runtime (equinox) is running with a lower JRE than the plug-in will not be loaded.

So marked the EE carefully to the lowest JRE you wish to support.


Similarly, ensure the Java compliance level matches the EE.

For example, assume the EE is set to J2SE-1.4 and the Java compliance to 1.5. Now, if you use annotations, the code would still compile in your workspace. However, when deploying, the plug-in would fail it will tell OSGi that it can run with 1.4 but actually it can not.


Saturday, July 23, 2011

Extension Point Schema Builder

The name says it all. This builder is responsible for compiling the extension point schema files. But they are  exsd (xml format) files. What would one compile them in to. HTML of course :)

So the name does not really says it all. Before we proceed, we need to see the Schema compiler preferences.

This page gives the the preference to generate the documentation for the extension point schema. When checked, a reference document is generated for each schema. The document (in HTML format) is generated in the folder name as provided in the preference page. As you can see, the default value is 'doc'. The extension point schema builder is responsible for creating this document. If the check-box is not checked, then this builder will not do anything. 

Friday, July 22, 2011

Plug-in Manifest Builder

Plug-in Manifest Builder or in short, manifest builder is contributed by PDE through org.eclipse.pde.core plug-in. This is the builder that would compile your plug-in each you change plug-in dependencies, modify build.properties, change classpath, add or remove libraries, save your code/classes. It compiles the plug-in and validate that required files (plugin.xml, etc) are in place and in correct shape.

You may have a look at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker for the exact details.

It is one of the two builder that any plug-in/fragment or equinox bundle project will have by default. It is a bit paranoid builder. If it can not understand any change (resource delta) it will go for full build of the project.

The Plug-in Manifest Compiler preference page has a bunch of options that control the problem severity generated by the builder.