Electronic – Which files to version control in mplabx nbproject directory


I just discovered the files in the directory nbproject are required for MPLABX to realize a .X directory is a project. I don't want my teammates to continually struggle with having to update every single time I make a small change, like recompile. What are the minimum files I should I add to my version control system?

Screenshot of what I think are too many files to manage a project:

enter image description here

Best Answer

We use Mercurial for our embedded projects at the office, including MPLAB X. I came up with the following guidelines for the team when Mercurializing MPLAB X projects:

  • Version all of the source files in the project root directory (duh)
  • Version the Makefile in the project root directory
  • Inside \nbproject, version the following:

    • configurations.xml
    • project.properties
    • project.xml
  • Inside \nbproject\private, version everything:

    • configurations.xml
    • private.properties
    • private.xml

This works well for us where we have varying operating systems and varying versions of MPLAB X. Cloning the repo and opening it works, MPLAB X will recreate the missing files and away you go. The only nuisance will be having to select your own programmer/debugger in project config, but there's no avoiding that - MPLAB X tracks the tools by serial number.

Before starting all this, we also figured out that we need the compilers to be installed in a common location (C:\Microchip\MPLABXC16\vX.XX, C:\Microchip\MPLABXC32\vX.XX, etc.) because depending on 32-bit or 64-bit O/S they end up in \Program Files or \Program Files (x86) which was problematic. I don't think this is still necessary with the above versioning scheme - YMMV.