An AspectJ plugin for bnd(tools)

I am experimenting with AspectJ. Aspects allow you to write a cross cutting concern that gets applied at selective points anywhere in your bundles (or 3rd party bundles).

I created a bnd exporter plugin that will create an executable JAR, and then use the AspectJ compiler ajc to weave each bundle based on aspect bundles. The aspect bundles and a properly wrapped aspectj runtime bundle are also added.

Aspects do not map very well to modules since they are crosscutting. I tried to keep the modularity of OSGi while still allowing the full support. However, some actual usage is needed. If people want to give this a test ride, you can find the manual here.

Awesome. I will take a look.

Is there a place I can directly download the required bundle?..
aQute.bnd.aspectj.plugin.AspectJ

It is built-in. Supporting it turned out to be very small:

     https://bnd.bndtools.org/plugins/aspectj.html

This requires I am on a certain version of bndtools? I am going to have to do some searching to figure out what versions of the aqute libs we are using with gradle.

Yes, it should be in 5.3, the latest release. I think but too laze to check :slight_smile:

For older releases, would a bundle.jar with -pluginpath work to bring it into the fold?

I guess you have to extract the jar then since it is part of the core bndlib jar. But yeah, that should work.