-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OSGi metadata to asciidoctorj-core jar #328
Conversation
I have no experience in OSGi so I cannot say anything, but it seems good to me for what I know about OSGi. |
"org.asciidoctor.extension;version=\"${version}\"", | ||
"org.asciidoctor.extension.spi;version=\"${version}\"" | ||
instruction 'Import-Package', | ||
'com.beust.jcommander;resolution:=optional', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this line is necessary? Would the CLI ever be used from an OSGi environment. It's not really intended to be an API atm. But perhaps I'm missing a use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely. It means that this import isn't required, so that the bundle will resolve even if the package com.beust.jcommander
isn't available. All other packages are required though.
The gradle osgi plugin uses the bnd tool (https://github.com/bndtools/bnd) which processes these lines to produce the actual JAR and the final MANIFEST.MF.
You can also see that org.asciidoctor.cli
is not part of the exported packages. It is still in the JAR but not exported, thus in an OSGi environment, other bundles can not use/see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification! Now I get it.
👍 |
Are there any more objections or questions? |
Not from me. My vote is to merge. @robertpanzer or @lordofthejars? |
Add OSGi metadata to asciidoctorj-core jar
I wonder if we want to add integration tests in an osgi environment, i.e. Arquillian-osgi? |
Unfortunately, I'm not familiar with Arquillian-osgi. Also, there is not much to test, currently; only that the bundle resolves properly after all required dependencies are resolved. |
I was just thinking about some smoke test so that we would be warned before releasing when sth changed. Best regards
|
Yeah, you are right. We should test if using the Asciidoctor API in OSGi actually works. So, we need to write and test a consumer bundle. Later, when we introduce a proper µService via the OSGi registry, we would need to refactor that test though. If somebody comes up with a skeleton for the test, I can help to fill in the gaps. |
Cherry-picked in asciidoctorj-1.6.0 87ff773 |
Just to keep the info somewhere:
The arquillian-jmx-protocol invokes |
This just added some OSGi Metadata to the asciidoctorj-core.jar and makes it a OSGi bundle. That way, it can be loaded and used in OSGi environments as-is.
It does not add any special OSGi support, e.g. a
BundleActivator
or some service registrations. See also #297.