]> Repositories - Adafruit_Blinka-hackapet.git/blob - test/scripts/upload_feather_huzzah_micropython_put.sh
Revert back to using setup.py to fix install problems
[Adafruit_Blinka-hackapet.git] / test / scripts / upload_feather_huzzah_micropython_put.sh
1 #!/bin/sh
2 # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
3 #
4 # SPDX-License-Identifier: MIT
5 PORT=/dev/ttyUSB0
6
7 export MPYCROSS=`realpath ../../../micropython/mpy-cross/mpy-cross`
8
9 # switch to test sources
10 cd ../src
11 # create test source directories on board
12 find testing -type d | \
13         grep -v -E "(^./.git.*|^./.idea|^./.vscode|__pycache__)" | \
14         xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
15 # compile source .py files to .mpy
16 find . -type f -name '*.py' | \
17     xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
18 # upload bytecode .mpy files
19 find . -type f -name '*.mpy' | \
20         xargs -n1 -I {} sh -c "echo uploading {} ...; ampy --port ${PORT} put {} {}"
21
22 #switch to test libraries
23 cd ../libraries/
24
25 # Compile adafruit libraries to bytecode and upload
26 for SUBMODULE in `find . -mindepth 1 -maxdepth 1 -type d `
27 do
28     cd ${SUBMODULE}
29     # create adafruit library directories on board
30     find . -mindepth 1 -type d | \
31             grep -v -E "(^./.git.*|__pycache__|^./doc.*|^./example.*)" | \
32             xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
33     # compile adafruit library .py files to .mpy
34     find . -type f -name '*.py' | \
35         grep -v -E "(^./conf.py|^./docs/conf.py|^./setup.py|^./example.*)" | \
36         xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
37     # upload adafruit library .mpy files
38     find . -type f -name '*.mpy' | \
39         xargs -n1 -I {} sh -c "echo uploading {} ...; ampy --port ${PORT} put {} {}"
40     cd ../
41 done
42
43 # switch to adafruit_blinka source
44 cd ../../src
45
46 find . -mindepth 1 -type d | \
47         grep -v -E "(^./.git.*|__pycache__)" | \
48         xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
49 # compile adafruit blinka .py files to .mpy
50 find . -type f -name '*.py' | \
51     xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
52 # upload adafruit blinka .mpy files
53 find . -type f -name '*.mpy' | \
54     xargs -n1 -I {} sh -c "echo uploading {} ...; ampy --port ${PORT} put {} {}"