-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
allow sub-classes of project to provide repos #6488
base: master
Are you sure you want to change the base?
allow sub-classes of project to provide repos #6488
Conversation
- add method Project.getRepositories() - override it in BndRun to provide a different list of plugins than Project () Signed-off-by: Christoph Rueger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks useful!
@laeubi ok thanks for having a look. Currently it is almost doing the same as what Workspace ( The "problem" with I think in case of my change in Or should I first call something like Thoughts welcome |
I think this is going to have backward compatibility issues. The idea that repositories come from the workspace is pretty deep engrained in a lot of code. A bndrun is actually a Project AND a Workspace. This needs a lot of testing with existing builds. |
Ok thanks for your feedback. It was more of a idea / proposal at first. Maybe: should sub-classes like BndRun just be able to "add" Repositories instead of passing the complete list? (so that the Workspace repos would always be used as it is at the moment, but sub-classes can add additional ones.) |
Signed-off-by: Christoph Rueger <[email protected]>
Bndrun is special, the -standalone was a hack. But we really needed to make a synthetic workspace I recall. I see the usefulness of adding repositories on a project but I see a lot of issues on that road. Key thing is that is must be backward compatible. And the plugins have a peculiar inheritance model. Since repositories can take significant initialization time you also have to handle the issue that the repo might not be ready. We handle that for workspace repos. Lots of bears ... |
Also notice that this repository will not be visible in the repositoriesview and it might be problematic for the resource view. |
I know that there are cornercases but wanted to mention that I explicitly use this as some kind of "commandline action" or better as running something programatically thats also why I try to avoid to pollute the original workspace. As you say bndruns are project+workspace, I wonder if I can add the plugin to the bndruns workspace without affecting the one passed in the constructor? |
You should be able to add a new repository with |
I think this is what @laeubi is trying to do but it fails:
But that does not seem to work, because the Repositories of
are cached (Memoize)
Maybe that is the missing piece in the puzzle... How would that refresh look?
or something like that?
|
Just take this simple testcase:
Output is:
As said it works perfectly fine for the resolve case, because that is using Repositories are memorized, yes but in this case the |
The testacse does not expect anything, it just shows that adding a plugin to a Bndrun and then query for a plugin through workspace does not return the plugin. This is actually expected to me. |
you are right, I was not precise in my words. I just wanted to find out, if we all agree that this is the problem we are trying to solve. |
Based on example provided by @laeubi Signed-off-by: Christoph Rueger <[email protected]>
Closes #6481