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
fix #913 Apply BND convention to shadowJar as well #915
Conversation
cc @simondaudin @agjini @swimmesberger can you look at the generated MANIFEST and assert its correctness? MANIFEST for `shadowJar`
|
3d5ab07
to
d473c7d
Compare
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.
Can we add a test that checks that OSGi metadata is generated?
We have checks for the final binary here https://github.com/reactor/reactor-netty/blob/master/src/jarFileTest/java/reactor/netty/JarFileShadingTest.java
build.gradle
Outdated
@@ -14,6 +14,7 @@ | |||
* limitations under the License. | |||
*/ | |||
import org.gradle.api.internal.plugins.osgi.OsgiHelper |
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 we need this org.gradle.api.internal.plugins.osgi.OsgiHelper
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.
I removed it, but that made me realize that the test I was adding had to account for the case where a custom version is built with an additional version component 👍
@simonbasle at first glance the posted manifest seems ok - when I compare it to the 0.9.1 version of the manifest I see a difference in the symbolic name: That should probably corrected so we don't have a symbolic name change between a minor version (maybe that can be unit tested too?) I would also suggest that the string provided to bnd for both build task (shaded and not shaded) should be extracted into a variable which can be used by both to ensure that for future changes both tasks are similarly up to date. |
@simonbasle the manifest seems ok, I see correct optional imports in 'Import-Package' section. |
@violetagg added tests for the content of the MANIFEST, and addressed the inconsistencies found by @swimmesberger |
Actually, I have one issue, with 'internal' imports |
Like @simondaudin said by further comparing the 0.9.1.RELEASE version with the 0.9.3.BUILD-SNAPSHOT the following is missing:
|
@simondaudin @swimmesberger please suggest a configuration for bndtools to fix that, I have no idea why and how all this stuff is generated, nor whether or not these differences between what |
If the idea was to simply blacklist the shaded "reactor.netty.internal" package from the manifest changing "!internal" to "!reactor.netty.internal*" would be enough. |
@swimmesberger @simondaudin that's for the |
ok I'll need to split this PR into two: one is fixing the shadowJar having no OSGI metadata at all (913) and the other one is the |
@simonbasle I kind of advice against using such a broad wildcard like !internal. So if you simply want to ensure that the shaded package is not exported you can safely change it to "!reactor.netty.internal*" too. Generally I would suggest following instructions:
Dunno why extactly you used exportcontents but Export-Package should work fine in most use cases. |
daad889
to
6491d1d
Compare
6491d1d
to
a8b8f74
Compare
The bnd plugin only applies to the default `jar` task. Since we're now using the shadow plugin, `shadowJar` has no OSGI data in its MANIFEST. This commit fixes the situation by applying the bnd plugin convention to the shadowJar task. It also copies the bnd configuration since this is not inherited. The manifest content is tested for key OSGI and Java metadata (not including the detail of the import/export, though).
a8b8f74
to
9b71808
Compare
The bnd plugin only applies to the default
jar
task. Since we're nowusing the shadow plugin,
shadowJar
has no OSGI data in its MANIFEST.This commit fixes the situation by applying the bnd plugin convention to
the shadowJar task. It also copies the bnd configuration since this is
not inherited.