Skip to content

Commit f5f1b33

Browse files
committedMar 17, 2021
Improve packager
1 parent a19e6cc commit f5f1b33

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed
 

‎package.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,30 @@
33
# The scope of this file is splitting the build into self consistent packages for distribution
44

55
# First target: makers
6-
VARIANTS="NANO_RP2040_CONNECT ARDUINO_NANO33BLE"
7-
FQBNS=("nanorp2040connect" "nano33ble")
8-
LIBRARIES="PDM SPI Wire MRI USBHID USBMSD ThreadDebug Scheduler"
6+
FLAVOUR="makers"
7+
VARIANTS=("NANO_RP2040_CONNECT ARDUINO_NANO33BLE")
8+
FQBNS=("nanorp2040connect nano33ble")
9+
LIBRARIES=("PDM SPI Wire MRI USBHID USBMSD ThreadDebug Scheduler")
10+
BOOTLOADERS=("nano33ble")
911

1012
# Remove mbed folder content
1113
rm -rf cores/arduino/mbed/*
1214
# Remove libraries not in $LIBRARIES list
1315
mkdir _libraries
1416
cd libraries
15-
mv $LIBRARIES ../_libraries
17+
for library in $LIBRARIES; do
18+
mv $library ../_libraries
19+
done
1620
cd ..
1721
rm -rf libraries
1822
mv _libraries libraries
1923

2024
# Remove variants not in $VARIANTS list
2125
mkdir _variants
2226
cd variants
23-
mv $VARIANTS ../_variants
27+
for variant in $VARIANTS; do
28+
mv $variant ../_variants
29+
done
2430
cd ..
2531
rm -rf variants
2632
mv _variants variants
@@ -36,4 +42,17 @@ mv _boards.txt boards.txt
3642
./mbed-os-to-arduino -b origin/latest -a NANO_RP2040_CONNECT:NANO_RP2040_CONNECT
3743
./mbed-os-to-arduino ARDUINO_NANO33BLE:ARDUINO_NANO33BLE
3844

39-
#Package!
45+
# Remove bootloaders not in $BOOTLOADERS list
46+
mkdir _bootloaders
47+
cd bootloaders
48+
for bootloaders in $BOOTLOADERS; do
49+
mv $bootloaders ../_bootloaders
50+
done
51+
cd ..
52+
rm -rf bootloaders
53+
mv _bootloaders bootloaders
54+
55+
#Package! (remove .git, patches folders)
56+
cd ..
57+
tar --exclude='*.git*' --exclude='*patches*' -cjhvf ArduinoCore-mbed-$FLAVOUR-$VERSION.tar.bz2 ArduinoCore-mbed
58+
cd -

0 commit comments

Comments
 (0)
Please sign in to comment.