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

  • \$\begingroup\$ This seems to be purely a software question, maybe best asked at stackoverflow. What is the recommendation at microchip? \$\endgroup\$ – gbulmer Oct 2 '14 at 0:44
  • 1
    \$\begingroup\$ Some information from Microchip on the files and directories is here: microchip.wikidot.com/mplabx:directory-structure \$\endgroup\$ – David Nov 26 '15 at 13:35

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.

  • \$\begingroup\$ this is the correct and official answer \$\endgroup\$ – Jason S Sep 9 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.