Skip to content

Commit

Permalink
Add N&N for PDE Bundle/Version Annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi authored and akurtakov committed Aug 8, 2022
1 parent 611cf22 commit d8dbbf6
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 1 deletion.
Binary file added 4.25/images/bunde-export-version-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4.25/images/consumer-type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4.25/images/header-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4.25/images/manifest-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4.25/images/manifest-example2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 74 additions & 1 deletion 4.25/pde.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h2>Plug-in Development Environment</h2>
<li><a href="#editors">Editors</a></li>
<li><a href="#APITools">API Tools</a></li>
<li><a href="#pde-compiler">PDE Compiler</a></li>
<li><a href="#GeneralUpdates">General Updates</a></li>
</ul>

<!-- ****************** START OF N&N TABLE****************** -->
Expand Down Expand Up @@ -58,6 +59,11 @@ <h2>Plug-in Development Environment</h2>
<tr>
<td id="pde-compiler" class="section" colspan="2"><h2>PDE Compiler</h2></td>
</tr>
<!-- ******************** End of PDE Compiler ********************** -->
<!-- ******************* General Updates ************************************* -->
<tr>
<td id="GeneralUpdates" class="section" colspan="2"><h2>General Updates </h2> </td>
</tr>

<tr id="default-3rd-party-bundles">
<td class="title"><a href="#default-3rd-party-bundles">Default target platform ships different 3rd party bundles</a></td>
Expand All @@ -69,7 +75,74 @@ <h2>Plug-in Development Environment</h2>
documentation</a> for details about possible issues and remediation.</p>
</td>
</tr>
<!-- ******************** End of PDE Compiler ********************** -->
<tr id="default-osgi-annotations">
<td class="title"><a href="#default-osgi-annotations">Support for the OSGi Bundle and Versioning Annotations</a></td>
<td class="content">
<p>PDE now supports the <a href="https://docs.osgi.org/specification/osgi.core/7.0.0/framework.api.html#org.osgi.annotation.bundle">OSGi Bundle</a> and
<a href="https://docs.osgi.org/specification/osgi.core/7.0.0/framework.api.html#org.osgi.annotation.versioning">OSGi Versioning</a> annotations to be used in a Plugin Project.
</p>
<p>
To <b>enable</b> the annotations one only needs to add them to the target platform e.g. with the following locations:
<pre>
&lt;target name="annotations"&gt;
&lt;locations&gt;
&lt;location includeDependencyDepth="none" includeSource="true" missingManifest="error" type="Maven"&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.osgi&lt;/groupId&gt;
&lt;artifactId&gt;org.osgi.annotation.versioning&lt;/artifactId&gt;
&lt;version&gt;1.1.2&lt;/version&gt;
&lt;type&gt;jar&lt;/type&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;/location&gt;
&lt;location includeDependencyDepth="none" includeSource="true" missingManifest="error" type="Maven"&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.osgi&lt;/groupId&gt;
&lt;artifactId&gt;org.osgi.annotation.bundle&lt;/artifactId&gt;
&lt;version&gt;2.0.0&lt;/version&gt;
&lt;type&gt;jar&lt;/type&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;/location&gt;
&lt;/locations&gt;
&lt;/target&gt;
</pre>
but of course any other source is accepted (e.g. directory locations or update-sites).
</p>
<p>
You can now <b>use</b> them for example the following way on a package-info.java:
<pre>
@org.osgi.annotation.bundle.Export
@org.osgi.annotation.versioning.Version("1.0")
package bundle.annotations.project;
</pre>
Or on an interface
<pre>
import org.osgi.annotation.versioning.ProviderType;

@ProviderType
public interface ProviderInterface {

}
</pre>
and then they can be processed by other tools (e.g. bnd or tycho).
</p>
<p>
<b>PDE</b> has now also support for the <code>@Export</code> and <code>@Version</code> annotations, if you put them on a <code>package-info.java</code> file like this:
<img src="images/bunde-export-version-header.png" />
the <code>MANIFEST.MF</code> is updated accordingly
<img src="images/manifest-example.png" />
</p>
<p>
The same works for <code>@Header</code> annotation, adding this like this:
<img src="images/header-example.png" />
this results in an extra header added to the <code>MANIFEST.MF</code>
<img src="images/manifest-example2.png" />
</p>
</td>
</tr>
<tr><td colspan="2"/></tr>
</tbody>
</table>
Expand Down

0 comments on commit d8dbbf6

Please sign in to comment.