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

p2 exporter #5716

Merged
merged 7 commits into from
Sep 5, 2023
Merged

p2 exporter #5716

merged 7 commits into from
Sep 5, 2023

Conversation

pkriens
Copy link
Member

@pkriens pkriens commented Jul 6, 2023

This is an attempt to provide an exporter for p2 repositories.

@pkriens pkriens marked this pull request as draft July 6, 2023 17:02
@pkriens pkriens force-pushed the feature/p2 branch 3 times, most recently from 655ea9b to 2825001 Compare July 14, 2023 07:59
@pkriens pkriens requested a review from maho7791 July 14, 2023 08:37
@pkriens
Copy link
Member Author

pkriens commented Jul 14, 2023

#5716 I created a new P2 exporter.


Features can require bundles and other features.

Bundles will come from the `-runbundles` instruction. This instruction can be managed with the resolver but it can also be set manually. Standard rules apply. The workspace is consulted to find the bundles and their versions. The bundles will be the highest available version in the repository.
Copy link
Contributor

Choose a reason for hiding this comment

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

As a side note:
There are two kinds of P2 repos. One is a complete repository, that contains all transient dependencies. The second one, like the bnd P2 Repo just contains a set of bundles. The dependencies are resolved in all the other P2 repositories in a target platform.
I mentioned, that I also create an unfinished Exporter:
https://gitlab.com/gecko.io/geckoannotations/-/tree/develop/org.gecko.artifact.p2.exporter?ref_type=heads
I've also chosen the approach of taking -runbundles but only for the complete repository. For the one that should only contain my bundles and no transient dependencies I used the -runrequire instruction:
https://gitlab.com/gecko.io/geckoannotations/-/blob/develop/org.gecko.artifact.p2.exporter/src/org/gecko/artifact/p2/exporter/P2Exporter.java?ref_type=heads
I experienced, that the P2 resolver tries to resolve all dependencies against the target platform repos.

Copy link
Member Author

Choose a reason for hiding this comment

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

Using -runbundles does not preclude using -runrequires. The resolve operation sets the -runbundles?

It is a pity that I did not know this code ... I could not found the org.gecko.artifact.p2.P2RepositoryCreator though and most of the work seems to happen there?

label=Java ©; \
description=The Java language

In the a.bndrun file:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you also generate feature.xml out of these information?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

can you convert that to an XML schema? In the test I run the schema validator with this schema for common sense check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: This is how I created the metadata. (But I lacked of the rest of the exporter, because of to less bnd knowledge)
https://gitlab.com/gecko.io/geckoannotations/-/blob/develop/org.gecko.artifact.p2/src/org/gecko/artifact/p2/P2RepositoryCreator.java?ref_type=heads

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, lots of overlap. But mine works now :-) Do you think we can pick/learn anything from your work?

---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
@pkriens pkriens marked this pull request as ready for review September 5, 2023 15:19
@pkriens pkriens merged commit 28d7aad into bndtools:master Sep 5, 2023
10 checks passed
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.

3 participants