bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
526 stars 304 forks source link

Add support for repository tags #6116

Closed chrisrueger closed 2 weeks ago

chrisrueger commented 1 month ago

Closes #5966

Based on brainstorming here https://bnd.discourse.group/t/baseline-repo-exclude-from-the-build-path/391/6

In this PR

e.g. a .bndrun file without -runrepos would include the following repos in the resolution:

aQute.bnd.repository.maven.provider.MavenBndRepository;\
        tags = "resolve"; \
        name="Maven Central A";\
        releaseUrl="${mavencentral}";\
        snapshotUrl="${ossrh}";\
        index="${.}/central.mvn";\
        readOnly=true,\

because it has the resolve tag

and

aQute.bnd.repository.maven.provider.MavenBndRepository;\
        name="Maven Central B";\
        releaseUrl="${mavencentral}";\
        snapshotUrl="${ossrh}";\
        index="${.}/central.mvn";\
        readOnly=true,\

because there is no tags

but not

aQute.bnd.repository.maven.provider.MavenBndRepository;\
        tags = "someothertag"; \
        name="Maven Central";\
        releaseUrl="${mavencentral}";\
        snapshotUrl="${ossrh}";\
        index="${.}/central.mvn";\
        readOnly=true,\

because it has a no resolve tag.

To exclude the baseline repo in the example, you would not add the resolve tag to the baseline-repo, and then it won't be considered for Resolving. I have not used baselining yet, so I am not familiar with the topic and what areas are not covered by this.

The current state of the PR just lay the foundation for tagging. More features could be added like allowing for NOT or more sophisticated filter expressions.

chrisrueger commented 1 month ago

Summary from the bnd zoom call today:

That's it so far. I will post an update once I have this implemented and from there we can discuss the next step.

Thanks @pkriens for the input.

chrisrueger commented 1 month ago
  • revert the Respositories Panel support for tags (e.g. @resolve) in -runrepos... just keep it a list of workspace names and a way to be specific
  • start a step back with an assumed empty -runrepos list or no -runrepos at

    • in this case the repostories should be fetched via something like repos = getPlugins(..., "resolve") - the second param should be the tag resolve which should be one a handful of fixed core-tags
    • every Repository should automatically have this tag resolve tag

@pkriens I have implemented the above.

Example: this is my Repositories list with no -runrepos specified

image

It is basically all repos with the resolve tag (repos have not tags specified, so the default 'resolve' is used)

Resolution:

Quoting commit b9a574f

Let's discuss

chrisrueger commented 1 month ago

@pkriens I have pushed the changes from our call today. In the UI I have implemented a simple Combobox mechanism where you can provide the options using a comma-separated string.

see 7f04909

image