I have exactly the same problem with exactly the opposite requirement - I have a custom board I’d like to package Arduino support for, but explicitly do NOT want to distribute it (it’s a proprietary board, and at a minimum would represent clutter, besides that I don’t want to do the paperwork to get dissemination approved).
Is there a way to package a framework variant in the project dir, the same way I can simply add a “boards/myboard.json”?
Way back in 2016 there was a mention here that PIO 3.x would support this, but the documentation is very sparse and extends only to the board.json
file, not any underlying variant that might be necessary.
Another suggestion was to define custom preprocessing scripts to copy the board variant into the proper framework directory, such that when it gets overwritten by an update, that won’t matter for future builds. But that seems like a tedious/messy way to do things. Is it still the only practical option?