Windows/Linux path separator for makeCustomizationPreStep
I have been developing my MPLAB X project in Linux. My project has a pre-build script to insert version information into a header.
I now have a Windows developer on the team. Ideally, the project will be committed to source control (git) and we can both contribute.
Besides the pre-build script, this process works without any extra work. For the build script, Linux has a shell script and Windows has a batch file. I found a solution that allows me to place the contents of the shell script and the batch file in the same file (). I've tested this and it works great!
The problem I'm having is with makeCustomizationPreStep in configuration.xml
On Linux, this works great.
However, this does not work on Windows and I had to change it to
From the MPLABX User's Guide -
If you plan on using MPLAB X IDE on different platforms (Windows, Mac, or Linux
operating systems), be aware of these issues:
• Use the forward slash “/” in relative paths. The backslash “\” works only on
Windows OS platforms. Example: #include headers/myheader.h
I am using the forward slash everywhere else. It does not cause any issue in the source code or other places in configuration.xml. However, for makeCustomizationPreStep, the forward slash only works for Linux and the backslash only works for Windows.
My question is: is there a platform agnostic path separator I can use in configuration.xml. As an alternative, is there anyway of enabling certain features based on OS detection - that is, have a script definition for Linux and and script definition for Windows.