Skip to content

Commit 7ca12e3

Browse files
committed
update build_all.py
1 parent efa33be commit 7ca12e3

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

tools/build_all.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,45 @@
1919
['metro_m0_tinyusb', 'adafruit:samd:adafruit_metro_m0:usbstack=tinyusb'],
2020
['metro_m4_tinyusb', 'adafruit:samd:adafruit_metro_m4:speed=120,usbstack=tinyusb'],
2121
['nrf52840', 'adafruit:nrf52:feather52840'],
22-
['feather_rp2040_tinyusb', 'rp2040:rp2040:adafruit_feather:flash=8388608_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb'],
23-
['metroesp32s2', 'espressif:esp32:adafruit_metro_esp32s2:CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=cdc,PSRAM=enabled,PartitionScheme=tinyuf2'],
24-
#[' ', 'espressif:esp32:adafruit_feather_esp32s3:FlashMode=qio,LoopCore=1,EventsCore=1,USBMode=default,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=cdc,PartitionScheme=tinyuf2'],
25-
['ch32v20x', 'WCH:ch32v:CH32V20x_EVT']
22+
['feather_rp2040_tinyusb',
23+
'rp2040:rp2040:adafruit_feather:flash=8388608_0,freq=125,dbgport=Disabled,dbglvl=None,usbstack=tinyusb'],
24+
['metroesp32s2',
25+
'espressif:esp32:adafruit_metro_esp32s2:CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=cdc,PSRAM=enabled,PartitionScheme=tinyuf2'],
26+
# [' ', 'espressif:esp32:adafruit_feather_esp32s3:FlashMode=qio,LoopCore=1,EventsCore=1,USBMode=default,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=cdc,PartitionScheme=tinyuf2'],
27+
['CH32V20x_EVT', 'WCH:ch32v:CH32V20x_EVT']
2628
]
2729

2830

2931
# return [succeeded, failed, skipped]
3032
def build_sketch(variant, sketch):
3133
ret = [0, 0, 0]
32-
3334
name = variant[0]
3435
fqbn = variant[1]
35-
3636
start_time = time.monotonic()
37-
# Skip if contains: ".board.test.skip" or ".all.test.skip"
38-
# Skip if not contains: ".board.test.only" for a specific board
37+
38+
# Skip if
39+
# - contains ".board.test.skip"
40+
# - contains any of ".board.test.only" but not this one
41+
# - conntain .skip.txt has this board in it
3942
sketchdir = os.path.dirname(sketch)
40-
if os.path.exists(sketchdir + '/.all.test.skip') or os.path.exists(sketchdir + '/.' + name + '.test.skip') or \
43+
if os.path.exists(sketchdir + '/.' + name + '.test.skip') or \
4144
(glob.glob(sketchdir + "/.*.test.only") and not os.path.exists(sketchdir + '/.' + name + '.test.only')):
42-
success = SKIPPED
4345
ret[2] = 1
46+
47+
skip_txt = f"{sketchdir}/.skip.txt"
48+
if os.path.exists(skip_txt):
49+
with open(skip_txt) as f:
50+
lines = f.readlines()
51+
for line in lines:
52+
if line.strip() == name:
53+
ret[2] = 1
54+
break
55+
56+
if ret[2] == 1:
57+
success = SKIPPED
4458
else:
4559
build_result = subprocess.run("arduino-cli compile --warnings all --fqbn {} {}".format(fqbn, sketch),
4660
shell=True, stdout=PIPE, stderr=PIPE)
47-
4861
# get stderr into a form where warning/error was output to stderr
4962
if build_result.returncode != 0:
5063
success = FAILED
@@ -93,8 +106,7 @@ def build_variant(variant):
93106
else:
94107
build_boards = all_boards
95108

96-
#all_examples = list(glob.iglob('examples/**/*.ino', recursive=True))
97-
all_examples = [f for f in glob.iglob('examples/**/*.ino', recursive=True) if 'examples/DualRole' not in f]
109+
all_examples = list(glob.iglob('examples/**/*.ino', recursive=True))
98110
all_examples.sort()
99111

100112
total_time = time.monotonic()

0 commit comments

Comments
 (0)