Which files to version control in mplabx nbproject directory?

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.


From http://microchip.wikidot.com/faq:72

Which files in an MPLAB® X Project should be under version control?

The following table lists project files that either need or do not need to be committed to a version control repository.

Directory or File(s) Commit?

Project Directory

Makefile Yes

Source files Yes

build directory No

dist directory No

nbproject directory

configurations.xml Yes

project.properties Yes

project.xml Yes

Makefile- * No

Package- * No

private directory No

Yes: Required to generate the project image. No: These directories/files are regenerated and therefore do not need to be saved.

Tags:

Mplabx