I spent the whole weekend on finding a nice solutions.
So let's restate the problem. There is a developer who works with big libraries and his libraries are dependent on each other and he wants the ability to test the libraries independent from higher level libraries. He also wants to use debugging tool and version control. The developer then wants to release his library in Arduino format for other people to use. I happen to be that guy.
1) The neatest solution considering all the Arduino compiling magic is: 1) Having debugging feature available in library folder. (not possible with visual micro currently)
2) The developer develop in library folder under Arduino, the includes all stay as the released version and he can easily add reference to other libraries.
3) He can add a .ino file in examples folder and test the library without a need for so much work and the example file remain with the project so the version control can track the project as well.
4) The libraries under development can easily include each other.
5) Nested file format is all good.
6) Version control is awesomely easy because you just need to take care of one folder and everything happens in that on folder.
7) You do not need to create multi copy of the project.
That all seems like a dream come true but visual micro does not support debugging in libraries. I cannot tell if there will be side effect because I could not try this.
The Solutions that do not work:
2) using shared project: It won't work because the shared project cannot include each other as reference. Also the project cannot be compiled unless it is presented next to an ino file (through reference). Version control become terrible since the project cannot compile on its own and you end up with files all over the place.
3) Using shared Library Same problem as #2
Note on shared projects: The shared project should be able to use each other once they are referenced in the same project based on what I read online, however I tested and it did not happen. I found only one person who had this problem on stackoverflow and he answered his own question after sometime and I left a comment to make sure I did not do anything wrong, so far no reply has been received.
https://stackoverflow.com/questions/26391523/shared-projects-is-it-possible-to-r... 4) Editing the include directory of one sketch to include another sketch: Long story short it did not work no matter how I played with it. It could not include files in the .ino file. .h and .cpp file could access the other sketches through relative path and if I remember correctly by adding the include directory. I tried so many tricks but the final conclusion was that there is no way to use another sketch's .h and.cpp in another sketch .ino file. Take note that you could use the .h and .cpp from another sketch in any sketch's .cpp and .h files if you provide correct relative path and turn of the deep search. Anyways this solution is not possible.
5) An ugly solution which works and after all is not that ugly I am not sure how this works on other setups so I am going to provide as much as information as possible.
I am running on windows 7, Visual Studio 2017 Community installed, SVN Tortoise for windows, Visual Micro Extension installed, VisualSVN extension installed. All works independently without an issue.
Some important stuff to consider:
1) The Arduino project cannot contain abc.ino, abc.cpp and abc.h all at the same time. The .h files and .cpp file should have a different name from .ino file.
2) In libraries used in Arduino, you can have a folder named src to keep all .h and .cpp files in a nested folder system without an issue.
3) In Arduino Sketch you can have .h and .cpp file under a folder named "src". Nested structure is supported too.
Now lets say you want to make a library and it is called "Apple". That means your library will have Apple.h and Apple.cpp. As stated the .ino should be something else. So, you can create a standard. I decided to add "_Testing" to my library name because it is easy to detect and kind of make sense with the rest of the file naming rules that I have set.
So in visual studio I create a new arduino sketch and call it "Apple_Testing". The IDE generates a Apple_Testing.ino and all files with Apple_Testing name to make it a project.
Next in solution explorer, click on "show all files". Then right click on the project and add a folder. Call the folder "src".
right click on folder and click on "Add empty arduino .cpp and .Header". Name it "Apple".
For some reasons Apple.h and Appler.cpp fall under project and not in the "src" folder. But it is not a big deal. Select them both and drag them inside "src". It will end up there nicely, a pop up message is generated but it is not important.
note: In "Apple_Testing.ino" you can include "Apple.h" by writing your include line like:
#include "src/Apple.h"
You then develop your Apple Library till the point that it is Commit worthy in your version control.
Now you have everything sorted out for Apple library.
Now you need to use VisualSVN. I am not going to write about the detail of SVN because it would be better if you learn that from another place and continue read the rest of this. The VisualSVN is based on SVN Tortoise for windows so you do not need worry much if you are familiar with SVN Tortoise.
You go VisualSVN menu and click on "add Solution to Subversion". There are things you have to fill up but those are typical stuff with the process.
Now you project is under subversion.
You have to commit to apply the changes you have made to bare folder in your repository.
Now it is time to see how we can use this project elsewhere.
To make it easier to understand, our next library is called "Fruit". As you might have guessed we use "Apple" in "Fruit" library. So "Fruit"Library needs access to Apple.h.
Well, first we clear "Fruit" in the same way as we did "Apple".
So you make a sketch and Name it "Fruit_Testing". Then you add a folder and name it "src". Then you go ahead and create "Fruit.h" and "Fruit.cpp". You start working with "Fruit" and when you are ready to add "Apple.h"
In order to add "apple.h" make sure Solution Explorer is showing all files. Then left click on src and open VisualSVN menu and click on "Get Solution from SVN". The naming is important. You want to keep it as simple as possible and you want includes to be as close as possible to library includes later when these sketches become actual libraries. So it is best to call the folder where Solution is going to be loaded, "Apple". (Note: if you name the Folder Apple_Testing, it will not be a good idea. Because if you keep the deep search on, you will have Apple_testing. Although this only happens if you have nested structure inside Fruit src. In this example we do not but this solution is supposed to keep you safe from future problems (hopefully

) )
After doing that the IDE may open Apple solution. You can just save all and close the Apple solution and open "Fruit" Sketch.
Now from "Fruit.ino" you can include "Apple.h":
#include "src/Apple/src/Apple.h"
From Fruit.h you can include "Apple.h"
#include "Apple/src/apple.h
You can now right the code you want and once your are done "Fruit" goes to SVN the same way as Apple.
To be continued....