Skip to content

Commit

Permalink
Add build_all script
Browse files Browse the repository at this point in the history
  • Loading branch information
photron committed Jul 5, 2024
1 parent 800d447 commit 6abf1a8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions software/build_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import sys

if sys.hexversion < 0x3060000:
print('Python >= 3.6 required')
sys.exit(1)

import glob
import configparser
import subprocess


def main():
for ini_path in sorted(glob.glob('*.ini')):
if ini_path.endswith('platformio.ini'):
continue

config = configparser.ConfigParser()
config.read(ini_path)

for section in config.sections():
if not section.startswith('env:'):
continue

env_name = section[4:]
args = ['pio', 'run', '-e', env_name, '-j', '2']

subprocess.check_call(args + ['-t', 'clean'])
subprocess.check_call(args)


if __name__ == '__main__':
main()

0 comments on commit 6abf1a8

Please sign in to comment.