Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Git versioning with Arduino project - what're correct steps? (Read 8260 times)
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Git versioning with Arduino project - what're correct steps?
Oct 2nd, 2016 at 6:58pm
Print Post  
My Arduino created projects work smooth but Git versioning complains that projects locations are outside of the Solution folder...
OK, after reading this:
https://msdn.microsoft.com/en-us/library/2b6th9de(v=vs.90).aspx
then I created a new Solution, created GIT repository, created within it Arduino projects and pasted my .ino code into them, rescanned, compiled ... Now Arduino files don't compile...
Please somebody give me the correct steps order how to create a solution with 2 Arduino projects within it, so that it do both: compile and do Git versioning. Also an overview of a correct files/directory structure to satisfy VM for both Arduino linked files and Git requirements ?
Thanks in advance
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Git versioning with Arduino project - what're correct steps?
Reply #1 - Oct 2nd, 2016 at 7:45pm
Print Post  
Hi,

If you create a project manually make sure the .vcxproj, the folder and a .ino file all have the same name. Otherwise Visual Micro will not mane the project.

Notice the solution explorer also shows a project name, this should also be the same.

\folder_project_name
   project_name.vcxproj
   project_name.ino

Foes this help?

The vsarduino.h can be excluded from git. In fact the vcxproj and .vsarduino.h are automatically maintained based on what can be deduced from the  physical code. Therefore it's only the real code that needs to be tracked with git but it's up to you how you work.

If you are expecting library sources to be stored in git you have a few options but might confuse this discussion so ask if need be.
« Last Edit: Oct 2nd, 2016 at 7:48pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Git versioning with Arduino project - what're correct steps?
Reply #2 - Oct 2nd, 2016 at 8:40pm
Print Post  
Thank you Tim. I checked - all those files match each project' folder name. Also I've never got to the step of "adding to repository" because Git repository does not get created. 
Trying "file->create source control" gave a window something like (from my memory):
"Git Versioning cannot create repository because project files are outside of the solution folder" and also ....... " if you want Git repository for your solutions, bring all project files under solution folder...
But as I reported before - then my code compilation got broken....
(can't reproduce steps to create repository - the menu option "file->create source control" is not there any more Embarrassed )
Looks like Git related code does not like locations of the project files although for both Arduino and Visual Studio directory structure is fine - no errors.
As if Git code imposes additional requirements on the directory structure/file locations...
Am I to choose either to use Git versioning or to have code compiled?  Smiley
??????????????
Vlad
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Git versioning with Arduino project - what're correct steps?
Reply #3 - Oct 2nd, 2016 at 8:42pm
Print Post  
For git, the project must exist in or below where the solution is located.

Maybe you just need to save the solution to a different location.
  
Back to top
WWW  
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Git versioning with Arduino project - what're correct steps?
Reply #4 - Oct 2nd, 2016 at 8:49pm
Print Post  
Important info to consider: 
all the naming of folders and files are matching as you mentioned but applied only to PROJECTs ( they are 2 in the solution), 
all the project folders (for all solutions) are in:
c:\Arduino_IFC\my_code\

yet the respective Solution is in another directory created according to VS common Option setup:
c:\Visual Studio 2015\
Seems the Git does not like that...
  
Back to top
 
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Git versioning with Arduino project - what're correct steps?
Reply #5 - Oct 2nd, 2016 at 8:53pm
Print Post  
Probably I have to move the solution to the same level as project folders:
c:\Arduino_IFC\my_code\

How to do that without braking compilation and without creating a new solution?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Git versioning with Arduino project - what're correct steps?
Reply #6 - Oct 2nd, 2016 at 9:48pm
Print Post  
The solution is a simple text file. Open with notepad and change path to relative. Solution next in parent folder with projects in sub folders below.
  
Back to top
WWW  
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Git versioning with Arduino project - what're correct steps?
Reply #7 - Oct 3rd, 2016 at 2:51am
Print Post  
Changed solution file, moved to c:\Arduino_IFC\my_code\  where project subdirectories are and that was still not enough... finally to get it working also had to remove previously created Git repositories from the \.git folder and in windows Registry following this advice: 
http://stackoverflow.com/questions/32304977/remove-git-mapping-in-visual-studio-...;
Then created new repos in TeamExplorer. 
Now I got both Git working and projects compile fine !
Thank you Tim
Vlad
  
Back to top
 
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Git versioning with Arduino project - what're correct steps?
Reply #8 - Oct 3rd, 2016 at 2:58am
Print Post  
On another thought : I would truly prefer to do versioning only for projects without Solution involved in Git. I tried to follow recommendations from 
https://msdn.microsoft.com/en-us/library/stxxt3fd(v=vs.90).aspx
but it is probably outdated... I don;t have 
DoNotCreateSolutionRootFolderInSourceControl in my registry
instead I have another :
CreateFolderForSolutionWasAlreadySet  set to '1'
Don;t know is it even possible to skip Solutions in Git...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Git versioning with Arduino project - what're correct steps?
Reply #9 - Oct 3rd, 2016 at 12:29pm
Print Post  
Hi,

Visual Micro uses standard Visual Studio C++ projects so whatever C++ projects support will work.

Visual Micro doesn't override or change any of these options so it's really a discussion for Microsoft or the author of the Git extension.

Thanks
  
Back to top
WWW  
IP Logged
 
Axel74
Newbies
*
Offline


Posts: 2
Joined: Jun 5th, 2018
Git versioning with Arduino libraries for project - what're correct steps?
Reply #10 - Jun 5th, 2018 at 1:32pm
Print Post  
Tim@Visual Micro wrote on Oct 2nd, 2016 at 7:45pm:
Hi,

If you are expecting library sources to be stored in git you have a few options but might confuse this discussion so ask if need be.


Hi,
I'm using visual micro with visual studio and Iam trying to have the arduino libraries I created stored in git. So far I only managed to have the main .ino file pushed.
How can I add the libraries source folder to git?
Thank you for your help!
« Last Edit: Jun 5th, 2018 at 1:51pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Git versioning with Arduino libraries for project
Reply #11 - Jun 5th, 2018 at 1:50pm
Print Post  
Hi,

The git tools work outside of visual micro with visual studio projects and solution.

I guess you can either:-

  Create (or let visual micro create) shared library projects (see the checkbox on the "Add Library" menu for an example). Then right click "References" for your your Arduino project and and add the libraries as "Shared Projects". Using this system the libraries can be in any location. There is also a "File>New>C++>Arduino Library" which shows more clearly how a library can become a "shared library project".

or 

  You can copy libraries to "project_folder\_micro-api\libraries" and then include them in the project using right click in the solution explorer. You will need to click the little "show all files" icon above the solution explorer to see the libraries you copied using windows explorer. Visual Micro will use the local libraries sources during builds but will treat them as libraries and not local project code. However, they will also be a part of the project as far as any GIT tools are concerned

« Last Edit: Jun 5th, 2018 at 1:51pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint