Skip to content

Commit c341d27

Browse files
committed
Initial: add packager script
1 parent 48245a4 commit c341d27

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

package.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# The scope of this file is splitting the build into self consistent packages for distribution
4+
5+
# First target: makers
6+
VARIANTS="NANO_RP2040_CONNECT ARDUINO_NANO33BLE"
7+
FQBNS=("nanorp2040connect" "nano33ble")
8+
LIBRARIES="PDM SPI Wire MRI USBHID USBMSD ThreadDebug Scheduler"
9+
10+
# Remove mbed folder content
11+
rm -rf cores/arduino/mbed/*
12+
# Remove libraries not in $LIBRARIES list
13+
mkdir _libraries
14+
cd libraries
15+
mv $LIBRARIES ../_libraries
16+
cd ..
17+
rm -rf libraries
18+
mv _libraries libraries
19+
20+
# Remove variants not in $VARIANTS list
21+
mkdir _variants
22+
cd variants
23+
mv $VARIANTS ../_variants
24+
cd ..
25+
rm -rf variants
26+
mv _variants variants
27+
28+
# Remove fqbns not in $FQBNS list
29+
touch _boards.txt
30+
for board in $FQBNS; do
31+
cat boards.txt | grep $board >> _boards.txt
32+
done
33+
mv _boards.txt boards.txt
34+
35+
#Recompile mbed core, applying patches on origin/latest
36+
./mbed-os-to-arduino -b origin/latest -a NANO_RP2040_CONNECT:NANO_RP2040_CONNECT
37+
./mbed-os-to-arduino ARDUINO_NANO33BLE:ARDUINO_NANO33BLE
38+
39+
#Package!

0 commit comments

Comments
 (0)