Skip to content

[FEA] Support Eclipse Features on -buildpath and container paths - #7339

Open
peterkir wants to merge 4 commits into
masterfrom
ecl-fea-buildpath
Open

[FEA] Support Eclipse Features on -buildpath and container paths#7339
peterkir wants to merge 4 commits into
masterfrom
ecl-fea-buildpath

Conversation

@peterkir

@peterkir peterkir commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Closes #7322

Features are now first-class citizens on -buildpath, -testpath, -runpath and -runbundles. The canonical syntax is:

-buildpath: org.eclipse.e4.rcp;version='4.40.0';type=org.eclipse.update.feature

A feature expands to its member bundles: references and
recursively, with platform filtering and exact→highest version fallback.

Core changes (biz.aQute.bndlib):

  • Container.TYPE.FEATURE with member expansion via Project.getFeatureMembers()
  • Type-aware version lookup via Repository.findProviders (not RepositoryPlugin.versions)
  • EclipsePlatform matcher for os/ws/arch platform filters
  • Project.getBundles() flattens features for all consumers (classpath, launcher, IDE)

Index changes (biz.aQute.repository):

  • Feature.toResource() enrichment with bnd.relation/id/version/type/os/ws/arch attributes
  • P2Indexer self-healing reindex for stale caches + .feature.jar cache-link suffix

UI changes (bndtools.core):

  • RepositoryBundleSelectionPart: canonical clause on DND and wizard add
  • SelectionDragAdapter: text drag produces canonical clause
  • VersionedClauseLabelProvider: feature icon in buildpath list
  • RepoBundleSelectionWizardPage: type-aware selection keying

SWTBot infrastructure (bndtools.core.test):

  • launch.rendered.bnd: RenderedLauncher for real Eclipse widgets
  • swtbot.tests.bnd: SWTBot test bundle with fixture workspace
  • FeatureBuildPathWizardSwtbotTest: Add Bundle dialog feature selection
  • FeatureBuildPathDndSwtbotTest: Repositories view drag→Build Path

Tests:

  • FeatureBuildpathTest (6 cases: nested, platform filter, cycles, fallback, optional, error)
  • FeatureParserTest.testMemberRelationAttributes (enrichment contract)
  • SWTBot UI tests (green on win32)

API changes:

  • aQute.bnd.build 4.7.1 → 4.8.0 (Container.TYPE.FEATURE)
  • aQute.bnd.osgi.resource 5.1.0 → 5.2.0 (TYPE_ECLIPSE_FEATURE, FEATURE_RELATION_*)
  • aQute.p2.provider 1.0.0 → 1.1.0 (relation attributes)

All changes additive; full backward compatibility.

Comment thread biz.aQute.bndlib/src/aQute/bnd/build/Container.java Outdated
@peterkir
peterkir force-pushed the ecl-fea-buildpath branch 2 times, most recently from caa5d30 to fc6c3ec Compare August 4, 2026 07:51
@peterkir peterkir linked an issue Aug 17, 2026 that may be closed by this pull request
@peterkir peterkir changed the title Support Eclipse features on -buildpath and container paths (#7322) [FEA] Support Eclipse Features on -buildpath and container paths Aug 17, 2026
peterkir added a commit that referenced this pull request Aug 28, 2026
Container previously had an Eclipse-specific TYPE.ECLIPSE_FEATURE
value with expansion logic (feature.xml relation parsing, os/ws/arch
platform filtering, version fallback) hardcoded in Project. Per
discussion on #7339, delegate typed-resource expansion to the
repository that recognizes the identity type instead of baking any
one vendor's semantics into core bnd.

- Container.TYPE.ECLIPSE_FEATURE -> TYPED_RESOURCE, vendor-neutral
  javadoc; Project.toContainer() now flags any identity with a
  type attribute as TYPED_RESOURCE, not just org.eclipse.update.feature
- New RepositoryPlugin#getTypedResourceMembers(Container, Set<String>)
  default method; repositories that don't recognize the type return
  null so others get a chance to expand it
- Project.getTypedResourceMembers() replaces the old Eclipse-specific
  getFeatureMembers()/getFeatureMember()/findFeatureResource() and
  simply loops repositories and delegates, keeping only generic
  cycle detection
- Move all Eclipse feature.xml specifics out of bndlib into the p2
  provider: P2Repository now implements getTypedResourceMembers();
  EclipsePlatform and the RELATION_*/TYPE constants move to
  aQute.p2.provider.Feature and aQute.bnd.repository.p2.provider
- Container.getMembers(Set<String>) made public so repository
  implementations can recurse while sharing the cycle guard
- Bump aQute.bnd.service.repository and
  aQute.bnd.repository.p2.provider package versions for the new
  default method (MINOR baseline change)
- Update bndtools.core call sites to the relocated Feature.TYPE
  constant; fix a duplicate convertRepoFeature() and a stray
  ECLIPSE_FEATURE switch case in SubsystemExporter left over from
  rebasing onto master
- Rewrite FeatureBuildpathTest to use a made-up type/relation
  vocabulary with its own RepositoryPlugin test double, proving
  Container/Project no longer know anything Eclipse-specific
- Fix RepoBundleSelectionWizardPage's "Available Bundles" search
  filter, which never matched RepositoryFeature/FeatureVersionNode
  entries so features were never filtered out

Signed-off-by: peterkir <peter@klib.io>
Features are now first-class citizens on -buildpath, -testpath, -runpath and
-runbundles. The canonical syntax is:

    -buildpath: org.eclipse.e4.rcp;version='4.40.0';type=org.eclipse.update.feature

A feature expands to its member bundles: <plugin> references and <includes>
recursively, with platform filtering and exact→highest version fallback.

Core changes (biz.aQute.bndlib):
- Container.TYPE.FEATURE with member expansion via Project.getFeatureMembers()
- Type-aware version lookup via Repository.findProviders (not RepositoryPlugin.versions)
- EclipsePlatform matcher for os/ws/arch platform filters
- Project.getBundles() flattens features for all consumers (classpath, launcher, IDE)

Index changes (biz.aQute.repository):
- Feature.toResource() enrichment with bnd.relation/id/version/type/os/ws/arch attributes
- P2Indexer self-healing reindex for stale caches + .feature.jar cache-link suffix

UI changes (bndtools.core):
- RepositoryBundleSelectionPart: canonical clause on DND and wizard add
- SelectionDragAdapter: text drag produces canonical clause
- VersionedClauseLabelProvider: feature icon in buildpath list
- RepoBundleSelectionWizardPage: type-aware selection keying

SWTBot infrastructure (bndtools.core.test):
- launch.rendered.bnd: RenderedLauncher for real Eclipse widgets
- swtbot.tests.bnd: SWTBot test bundle with fixture workspace
- FeatureBuildPathWizardSwtbotTest: Add Bundle dialog feature selection
- FeatureBuildPathDndSwtbotTest: Repositories view drag→Build Path

Tests:
- FeatureBuildpathTest (6 cases: nested, platform filter, cycles, fallback, optional, error)
- FeatureParserTest.testMemberRelationAttributes (enrichment contract)
- SWTBot UI tests (green on win32)

API changes:
- aQute.bnd.build 4.7.1 → 4.8.0 (Container.TYPE.FEATURE)
- aQute.bnd.osgi.resource 5.1.0 → 5.2.0 (TYPE_ECLIPSE_FEATURE, FEATURE_RELATION_*)
- aQute.p2.provider 1.0.0 → 1.1.0 (relation attributes)

All changes additive; full backward compatibility.

Signed-off-by: Peter Kirschner <peter@klib.io>
Container previously had an Eclipse-specific TYPE.ECLIPSE_FEATURE
value with expansion logic (feature.xml relation parsing, os/ws/arch
platform filtering, version fallback) hardcoded in Project. Per
discussion on #7339, delegate typed-resource expansion to the
repository that recognizes the identity type instead of baking any
one vendor's semantics into core bnd.

- Container.TYPE.ECLIPSE_FEATURE -> TYPED_RESOURCE, vendor-neutral
  javadoc; Project.toContainer() now flags any identity with a
  type attribute as TYPED_RESOURCE, not just org.eclipse.update.feature
- New RepositoryPlugin#getTypedResourceMembers(Container, Set<String>)
  default method; repositories that don't recognize the type return
  null so others get a chance to expand it
- Project.getTypedResourceMembers() replaces the old Eclipse-specific
  getFeatureMembers()/getFeatureMember()/findFeatureResource() and
  simply loops repositories and delegates, keeping only generic
  cycle detection
- Move all Eclipse feature.xml specifics out of bndlib into the p2
  provider: P2Repository now implements getTypedResourceMembers();
  EclipsePlatform and the RELATION_*/TYPE constants move to
  aQute.p2.provider.Feature and aQute.bnd.repository.p2.provider
- Container.getMembers(Set<String>) made public so repository
  implementations can recurse while sharing the cycle guard
- Bump aQute.bnd.service.repository and
  aQute.bnd.repository.p2.provider package versions for the new
  default method (MINOR baseline change)
- Update bndtools.core call sites to the relocated Feature.TYPE
  constant; fix a duplicate convertRepoFeature() and a stray
  ECLIPSE_FEATURE switch case in SubsystemExporter left over from
  rebasing onto master
- Rewrite FeatureBuildpathTest to use a made-up type/relation
  vocabulary with its own RepositoryPlugin test double, proving
  Container/Project no longer know anything Eclipse-specific
- Fix RepoBundleSelectionWizardPage's "Available Bundles" search
  filter, which never matched RepositoryFeature/FeatureVersionNode
  entries so features were never filtered out

Signed-off-by: peterkir <peter@klib.io>
Comment thread biz.aQute.bndlib/src/aQute/bnd/build/Project.java Outdated
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>

@synesty-cr synesty-cr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and compiles. I think the feature is in a good shape with minimal impact and minimal api extensions and allows to use it in other (potentially future) repositories.

@chrisrueger

Copy link
Copy Markdown
Contributor

@sad-poet Review from your end would be great

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.

Referencing p2 features in -buildpath

3 participants