Skip to content
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

Work around bndtools/bnd#5695 by configuring jar tasks eagerly #3354

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

tresat
Copy link
Contributor

@tresat tresat commented Jun 14, 2023

Eagerly configure Jar tasks to create the BundleTaskExtension prior to the Gradle compileClasspath configuration becoming locked and triggering it's beforeLocking callback to run. This allows the BND extension to modify the LibraryElements attribute on that configuration and request a variant with the "jar" value prior to Gradle automatically modifying the attribute to request the "classes" value. This ensures jars are present on the classpath for BND to use when checked for exported classes to use when building the manifest. If it only uses the classes directory for this task, it will not have access to version information and will not write version info to the manifest it is assembling for the current project, causing the verifyOSGi task to fail.

Addresses issue bndtools/bnd#5695 and allows merging of #3351.

Eagerly configure Jar tasks to create the BundleTaskExtension prior to the Gradle compileClasspath configuration becoming locked and triggering it's beforeLocking callback to run.  This allows the BND extension to modify the LibraryElements attribute on that configuration and request a variant with the "jar" value prior to Gradle automatically modifying the attribute to request the "classes" value.  This ensures jars are present on the classpath for BND to use when checked for exported classes to use when building the manifest.  If it only uses the classes directory for this task, it will not have access to version information and will not write version info to the manifest it is assembling for the current project, causing the verifyOSGi task to fail.

Addresses issue bndtools/bnd issue #5695 and allows merging of junit-team/junit5 pr junit-team#3351.
@tresat tresat mentioned this pull request Jun 14, 2023
@tresat tresat marked this pull request as ready for review June 14, 2023 14:21
@marcphilipp marcphilipp changed the title Workaround a BND + Gradle 8.2 issue blocking OSGi manifest verification Work around bndtools/bnd#5695 by configuring jar tasks eagerly Jun 15, 2023
@marcphilipp marcphilipp merged commit 287607c into junit-team:main Jun 15, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants