Sort the groups of files in a Keil uVision .uvprojx file.
As far as I can tell, uVision doesn't offer the ability to sort the order the source files appear in the project window. One could manually sort it via the "Manage Project Items" dialog, but that's too laborious for me.
This script will alphabetically sort the source files within a group, with the file's path as the sort key.
$ uvprojx-sort-files.py -h
usage: uvprojx-sort-files.py [-h] uvprojx
Sort the groups of files in a Keil uVision .uvprojx file. Modifies the file
in-place.
positional arguments:
uvprojx The path to the .uvprojx file.
optional arguments:
-h, --help show this help message and exit
Example: uvprojx-sort-files.py MyProject.uvprojx
It modifies the .uvprojx in place, so in Windows Explorer you can drag-and-drop the .uvprojx on to uvprojx-sort-files.py.
- Python 2.7.6
- lxml 3.3.5
- Keil uVision 5.14, 5.15.