Skip to content

Comments

Add AnalysisPlugin interface and implementation#7095

Draft
chrisrueger wants to merge 3 commits intobndtools:masterfrom
laeubi:copilot/fix-b557e6d0-f9ba-4e80-b858-62aea0092bf6
Draft

Add AnalysisPlugin interface and implementation#7095
chrisrueger wants to merge 3 commits intobndtools:masterfrom
laeubi:copilot/fix-b557e6d0-f9ba-4e80-b858-62aea0092bf6

Conversation

@chrisrueger
Copy link
Contributor

@chrisrueger chrisrueger commented Feb 11, 2026

Closes #6772

This pull request introduces a new AnalysisPlugin extension point to the bnd tool, allowing plugins to receive callbacks about analysis decisions—especially the reasoning behind version range choices for package imports. It provides both the interface and documentation for plugin authors, as well as comprehensive tests to ensure correct behavior and ordering.

The most important changes are:

New Plugin Extension Point

  • Added the AnalysisPlugin interface in aQute.bnd.service, enabling plugins to receive notifications about version range decisions and other analysis events during the bundle analysis phase. (biz.aQute.bndlib/src/aQute/bnd/service/AnalysisPlugin.java)

Analyzer Integration

  • Modified the Analyzer to call reportImportVersion() on all registered AnalysisPlugin instances whenever it determines a version range for an import, including a human-readable explanation for the decision. (biz.aQute.bndlib/src/aQute/bnd/osgi/Analyzer.java) [1] [2]

Documentation

  • Added a new documentation page describing the AnalysisPlugin interface, usage examples, and typical use cases for tracking and logging analysis decisions. (docs/_plugins/analysisplugin.md)

Testing

  • Introduced a comprehensive test suite for the AnalysisPlugin extension, verifying that plugins are called, receive correct version decision data, and respect plugin ordering. (biz.aQute.bndlib.tests/test/test/AnalysisPluginTest.java)

Copilot AI and others added 3 commits October 6, 2025 08:09
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way for collecting analysis results in the Analyzer

2 participants