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

auto register capabilities for META-INF/services #6309

Merged

Commits on Oct 7, 2024

  1. move logic to MetaInfServiceParser

    it leverages the recent addition of PR bndtools#5912 that allowed to add annotations in comments of files in META-INF/services. But in this PR we basically pretent and add a aQute.bnd.annotation.spi.ServiceProvider annotation artificially. this causes bnd to generate Provide-Capability manifest headers for the services
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    07bb70c View commit details
    Browse the repository at this point in the history
  2. docs for -metainf-services

    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    e959863 View commit details
    Browse the repository at this point in the history
  3. add test

    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    f9edbc6 View commit details
    Browse the repository at this point in the history
  4. add Syntax help

    e.g. onmouseover in bnd.bnd editor shows help text.
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    55b46db View commit details
    Browse the repository at this point in the history
  5. BndHover: show values in hover tooltip

    From this all instructions would benefit
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    974ace1 View commit details
    Browse the repository at this point in the history
  6. fix setPendantic

    Signed-off-by: Christoph Rueger <[email protected]>
    
    experimental: BndMavenPlugin set pendantic:true
    
    Experimental: this causes more logging output which could be important during building bundles (but maybe not for baselining, so we only do it in BndMavenPlugin)
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    2c68ec8 View commit details
    Browse the repository at this point in the history
  7. Revert "fix setPendantic"

    This reverts commit 96d6fdc.
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    045bc11 View commit details
    Browse the repository at this point in the history
  8. avoid requiring bnd.annotations dep

    This is a patch by and on behalf of @pkriens which fixes that a dependency to biz.aQute.bnd.annotation needs to be on the classpath. This simplifies wrapping bundles and use the new -metainf-services: auto instruction by not requiring additional bnd dependencies in the case where they are using the textual way of annotating metainf/services files with annotations in comments
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    16b43b3 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. update docs to recent patch

    - 'auto' as the new default makes things much easier for library authors since no additional configuration is required
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    f31f44c View commit details
    Browse the repository at this point in the history
  2. make 'auto' the new default

    This makes 'auto' the default again and fixes the previously failing tests.
    The problem was that the "@Serviceprovider" from our own classpath added Java-17 (or whatever was the Java version on the machine you are compiling) to the list of ees which had an impact on how osgi.ee was calculated... this broke all the tests.
    the fix was in Analyzer to ignore all classes added via addClasspathDefault() for calculation of the ees variable.
    
    Signed-off-by: Christoph Rueger <[email protected]>
    
    fix failing gradle tests
    
    filter out invalid fqn names e.g. key=value
    
    e.g. fixes [ERROR] [org.gradle.api.Task] error  : analyzer processing annotation key=value but the associated class is not found in the JAR
    
    because key=value is not a valid serviceImplementation name
    
    Signed-off-by: Christoph Rueger <[email protected]>
    
    add resolution: optional to try to fix test
    
    auto-registered annotations are added with "resolution: optional" directive, in order to fix tests which failed due to Unresolved requirements: osgi.extender; (&(osgi.extender=osgi.serviceloader.registrar)(version>=1.0.0)(!(version>=2.0.0))) which was added by the auto-registed annotations
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    cfbef6f View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. add lookAsideClasses to avoid classspace

    addClasspathDefault() adds the annotation class to lookAsideClasses instead of classspace and adjust findClass() which now also looks into this new map. That way we don't not put stuff in classspace which should not be there
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    ca16c50 View commit details
    Browse the repository at this point in the history
  2. remove FQN validation from MetaInfService

    we rely on the error in Analyzer.findClass() if someone puts garbage in services files
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    eb69453 View commit details
    Browse the repository at this point in the history
  3. split processing of services & default to 'auto'

    we decided to make '-metainf-services: annotation the default. so '-metainf-services: auto' has to explicity be enabled in bnd file.
    This decision was due to the fact that it is a brand new feature, and the impact on projects in the wild are hard to predict, since it changes metadata in MANIFEST.MF. So it is unclear at the moment if this would be considered a breaking change. So to be safe, we do not do 'auto' by default but 'annotation'. that means that textual annotations in META-INF/services files are automatically processed, because they were put there on purpose.
    
    this commit also adjusts and adds some testcases based on that behavior.
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    1e130b2 View commit details
    Browse the repository at this point in the history
  4. adjust docs to default: 'annotation'

    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    6a41538 View commit details
    Browse the repository at this point in the history
  5. css: horizontal scrollbar for wide code blocks

    fixes the little annoyance that some code blocks appeared cutoff on the right side
    
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    caa0a9b View commit details
    Browse the repository at this point in the history
  6. avoid duplicates if > 1 impls

    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    d342483 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2024

  1. add METAINF_SERVICES to Constants.options

    used by BndScanner
    Signed-off-by: Christoph Rueger <[email protected]>
    chrisrueger committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    e52fcde View commit details
    Browse the repository at this point in the history