--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-users/019d0511-2595-49ad-983c-563b044df514n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-users/7e56a2da-fbe8-4b67-9417-36472a1a3909n%40googlegroups.com.
On 23 Nov 2020, at 20:52, Rubén Pérez Vázquez <rube...@gmail.com> wrote:Hi all,I was trying to upload my BND workspace to Github for the first time and I get multiple errors.The workspace was created using the provided templates, so it already has multiple git-related files, such as .gitignore, .gitattributes and so on. The reason is that Eclipse's git plugin is expecting git resources to be inside projects, while Bndtools maps BND workspace to Eclipse workspace. In doing this, now Eclipse see files to commit to Git outside projects and complains about it (and rightly so, at least from its perspective). Is there any way to avoid these issues?
On the other hand, I was unable to "see" a BND workspace correctly without having it selected as the current Eclipse workspace at the same time. This is surprising because I have read some conversations in the bndtools repo issue tracker which seem to indicate that the intention was exactly the opposite --that the concepts of BND workspace and Eclipse workspace should be completely independent. However, in my experience they must be the same thing in practice, otherwise Bndtools gets confused.
To top it all, this confusion led me to making a mess with the configuration, and on trying to fix that I found yet another limitation: there is no option to import existing BND OSGI projects into the current workspace. It is possible, though, to create a new project and enter the name of an existing project, which will import it but completely clean its bnd.bnd
All in all, it looks that the support that Bndtools offers for BND workspace is somewhat incomplete or a work in progress.
I guess I've just written this to ask: are all those issues known and expected or am I doing something (or everything) completely wrong?
Thanks in advance for your answers.Best regardsRubén
On 24 Nov 2020, at 11:32, Rubén Pérez Vázquez <rube...@gmail.com> wrote:Dear Fr Jeremy,As always, thanks for you kind and informative answer. Please let me add some remarks to your answers:
- It may be possible, or perhaps it might have been possible to have a Bnd workspace in a subfolder of the Eclipse workspace (i.e. as an Eclipse project), but it does not seem to be the case anymore. As soon as one creates a new Bnd workspace, the Bndtools integration automatically switches Eclipse's current workspace to be the subfolder where the Bnd workspace was created. Indeed the files in the root of the Bnd workspace are mostly for configuring gradle and git -- which are the next steps in my little side project. Because now the Bnd workspace is also the current Eclipse workspace, as soon as I try to use EGit to push it to Github, I get errors in all these files. That does not mean that I cannot commit these files, but they appear as blank lines in EGit's "Git stating" view, and every time I do something with this files, I get this annoying popup error window telling me that there are errors in some files because their path does not include the project name (i.e. they are outside of a project, from Eclipse's perspective).
On the other hand, if I refuse to accept the automatic worspace switch that Bndtools does, I can of course switch back to the previous Eclipse workspace (File > Switch workspace), but of course I won't find my Bnd workspace there, because it was never imported (as a new project, for instance) into that Eclipse workspace.
In short, the only way I could find to work with a Bnd workspace is that it is, at the same time, the current Eclipse workspace. Otherwise, it won't work (but it will cause all these errors when converting the workspace into a git project).
- I will try that method and see if I can import the Bnd workspace as a project in a Eclipse workspace. I'll post my findings here. Anyway, it really seems like a hack more than a "sanctioned" way of importing Bnd projects. This goes with my earlier observation that the Bndtools integration seems incomplete or a work in progress or, at least, buggy.
- The "Import existing Bnd workspace" is, indeed, problematic. Let me explain: let's say my Eclipse workspace is in C:\workspace and I create a new bnd workspace in C:\workspace\example. That will automatically change my current Eclipse workspace to be also C:\workspace\example,
- but at this point I am blissfully unaware of the problems that this will cause down the line and start to create new Bnd projects -- let's say C:\workspace\example\project1 and C:\workspace\example\project2 alongside the C:\workspace\example\cnf created by Bndtools. But after that I decide I want to work with my Bnd workspace without it being the Eclipse workspace. So I switch my Eclipse workspace back to C:\workspace and try to import the existing Bnd workspace using the "Import existing Bnd workspace" option. This will display an error popup:
"'Import Bnd Workspace' has encountered a problem.
Cound not finish import job for Bnd Workspace!
, with no further details. In addition, two empty new folders will have been created in the workspace: C:\workspace\cnf and C:\workspace\project1. It seems that "Import existing Bnd workspace" tries to convert your current workspace into the workspace you are trying to import (but fortunately failing in the process). Interestingly enough, if I delete the C:\workspace\cnf and C:\workspace\project1 folders and try again, the process will fail with the same error message, but now the empty folders C:\workspace\cnf and C:\workspace\project2 will have been created, as if Eclipse remembered that it had already tried to import project1 or, perhaps, as if the import order is random.
Bottom line is, the name "Import Bnd Workspace" is extremely misleading and it should be called "Convert the current workspace into an existing Bnd workspace", or something like that. It is definitely not what one is expecting when using that option.Now, don't get me wrong. I like the OSGI model and I like many of the features that Bndtools offers, but the devil is in the details, and these details I've commented on here are certainly not a reason to abandon Bnd tools completely, but extremely annoying IMHO.
Thanks for bearing with my rant here and I hope someone finds it, at least, informative or useful.
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-users/7e56a2da-fbe8-4b67-9417-36472a1a3909n%40googlegroups.com.
The current best practice, at least in my mind, is to dedicate one single directory, that has:
workspace/.git/ marks it as the git workspace.metadata/ marks it as an Eclipse workspacesettings.gradle marks it as a gradle rootcnf/ marks it as a bnd workspacecom.foo.example.bar/ project (= Symbolic Name)bnd.bnd bnd project marker.gitignore ignores .metadata, .gradle-wrapper and others
I don't like having my projects in a workspace (if anyone's
interested why: my projects live in directories synchronized with
the cloud and synchronizing an eclipse workspace with cloud
storage is an unpleasant experience). Using Eclipse's nested
project feature, my layout is
Combined with the hierarchical view in the project explorer, this works extremely well. A big advantage is that I can do git operations "for everything" in Eclipse.
Regards,
Michael
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-users/3DAAFF76-5A72-47CC-B39F-2DF0F787B84C%40gmail.com.
On 25 Nov 2020, at 09:43, Michael Lipp <m...@mnl.de> wrote:The current best practice, at least in my mind, is to dedicate one single directory, that has:workspace/.git/ marks it as the git workspace.metadata/ marks it as an Eclipse workspacesettings.gradle marks it as a gradle rootcnf/ marks it as a bnd workspacecom.foo.example.bar/ project (= Symbolic Name)bnd.bnd bnd project marker.gitignore ignores .metadata, .gradle-wrapper and othersI don't like having my projects in a workspace (if anyone's interested why: my projects live in directories synchronized with the cloud and synchronizing an eclipse workspace with cloud storage is an unpleasant experience).
Using Eclipse's nested project feature, my layout is
overall-project/.project Eclipse "general" project.git/ marks it as the git workspacesettings.gradle marks it as a gradle rootcnf/ marks it as a bnd workspacecom.foo.example.bar/ project (= Symbolic Name)bnd.bnd bnd project marker.gitignore ignores .metadata, .gradle-wrapper and othersbuild.gradle
Combined with the hierarchical view in the project explorer, this works extremely well.
A big advantage is that I can do git operations "for everything" in Eclipse
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-users/0858a6af-3625-6717-0b69-32fb029200c3%40mnl.de.
Using Eclipse's nested project feature, my layout is
overall-project/.project Eclipse "general" project
.git/ marks it as the git workspacesettings.gradle marks it as a gradle rootcnf/ marks it as a bnd workspacecom.foo.example.bar/ project (= Symbolic Name)bnd.bnd bnd project marker.gitignore ignores .metadata, .gradle-wrapper and othersbuild.gradle
I can see how this confuses the hell out of Eclipse. I would never ever have a project at the root. your 'overall-project' is the bnd & git workspace. If you now try to import projects, it will only see one project. I could imagine there are more places where it gets confused. Although it might work, it also violates the idea of the bnd workspace that all projects are on the same level. I have a customer that does this and I trip over it every time I have to do something with their workspace.
As mentioned, my Eclipse handles this perfectly well. Obviously,
when you import the "overall-project" in Eclipse, you have to
check the "search for subprojects" and import those as well. (And
from bnd's point of view, all projects *are* on the same level.)
Together with your customer, this seems to make at least two of us
who like working this way.
A big advantage is that I can do git operations "for everything" in Eclipse
I do admit I abandoned EGit in the earlier days because it just did not work reliable. So I am in the shell for this work with a handy Mac tool for the visualizations. Maybe should give it another chance ...
As we all know, there are many ways to do something (especially
in Eclipse) and much is about personal preference. For me, the
"Commit window" (don't remember when they introduced it) turned
out to be a very good way to handle git.
Regards,
Michael
--
You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/ES9tOhfMtuI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-users/de916508-45a8-4214-2860-3cb9cda04a5f%40mnl.de.
On 26 Nov 2020, at 23:48, Rubén Pérez Vázquez <rube...@gmail.com> wrote:
Hi everybody,Let me start by addressing Peter Kriens' comment that I have been unfair. Yes, I think I have and I apologise. I can only imagine how many hours have gone into creating a nice environment to develop OSGi "natively". Sometimes we only focus on the problems and forget to mention the good things. So let me state here that there are many more things that I like than complaints. It's just that I was very frustrated when I wrote the message the other day.I have tested this again using a freshly installed Eclipse with the latest version of bndtools available at the Eclipse Marketplace. I think that I have seen what my problem was: I thought that, when creating a new bnd workspace, bndtools would automatically switch Eclipse workspace to be in the root folder of the bnd workspace, but it is not the case. What it does happen is that Eclipse imports the bnd projects as if they were in the root of the workspace because the intermediate folder (the root of the bnd workspace) is not itself a project. So, the fact that, I see the following in the Java Project Explorer:
<image.png>does not mean that those projects are physically in my current workspace. They are, in fact, both inside the folder workspace/org.example, but Eclipse never displays the org.example subfolder (which is the root of the bnd workspace) because it is not a project itself. Now I understand much better what Fr Jeremy Krieg and Peter Kriens meant, and I apologise if I didn't earlier.This, however, still presents a problem when I try to add elements to the bnd workspace. From Eclipse's perspective, these elements must be inside a project, but the root of the bnd workspace is not one. The other problem that I see is the fact that the projects inside the workspace are completely independent from the perspective of Eclipse.I think this model was practically mandatory back in the days where Eclipse did not handle and project with their subprojects very well. However, I don't think this is problematic anymore, and I do think that Michael Lipp's bnd-workspace-as-eclipse-parent-project approach is the most "native" solution, because Eclipse won't get confused when it sees all these resources in the root of the bnd workspace.As per Michael's advice, which is similar to what Fr Jeremy suggested (creating a .project file by copy-pasting another one), I tried to create a general project in the same folder as the bnd workspace described above (namely org.example). I selected "New > Project > General > Project", gave the name org.example and I got the following dialog:
<image.png>I selected both of them and voilá:
<image.png>Of course, the option "Project Presentation > Hierarchical" when clicking the "three points" menu of the Project Explorer must be selected. If a "Flat" presentation is selected, however, the view is more confusing:
<image.png>And the same happens with the Bndtools Explorer (which IMHO should be fixed):
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-users/CAFWAsK0ie8xy%3D9Un6USfiLoiJeY_RVDmVRtRtUJsVbEF5EvguQ%40mail.gmail.com.