I have a couple of custom ESP32 based boards I am working with and am wondering what the best way to include these is? Up until now I have edited boards.txt to append definitions for my two boards to add the two variants with custom pins_arduino.h files.
Is there a better way of doing this without modifying the boards.txt file? How would I go about doing this? The problem with boards.txt is every time there is an update this file gets overwritten. This is with IDE 2.x.
I think the best way is in post #4 by @kmin , but there's another way using boards.local.txt:
boards.local.txt
Introduced in Arduino IDE 1.6.6. This file can be used to override properties defined in boards.txt or define new properties without modifying boards.txt. It must be placed in the same folder as the boards.txt it supplements.
Unfortunately, I don't know what will happen to boards.local.txt and its variants/YOUR_CUSTOM_BOARD/pins_arduino.h when you update the IDE.
The boards platform installation is not affected in any way by updating Arduino IDE.
However, any changes you make to the platform installation (including the added boards.local.txt file) will be lost every time you update to a new version of the platform via the Arduino IDE Boards Manager. So if you are going to use this approach, make sure to save a copy of the boards.local.txt file to a safe location outside the platform installation folder. After updating the platform, simply copy the boards.local.txt file back into the platform installation folder and then restart Arduino IDE to add your custom board definition back to the platform.