4 export MPYCROSS=`realpath ../../../circuitpython_2.2.3/mpy-cross/mpy-cross`
 
   6 # switch to test sources
 
   8 # create test source directories on board
 
   9 find testing -type d | \
 
  10         grep -v -E "(^./.git.*|^./.idea|^./.vscode|__pycache__)" | \
 
  11         xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
 
  12 # compile source .py files to .mpy
 
  13 find . -type f -name '*.py' | \
 
  14     xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
 
  15 # upload bytecode .mpy files
 
  16 find . -type f -name '*.mpy' | \
 
  17         xargs -n1 -I {} sh -c "echo uploading {} ...; ampy --port ${PORT} put {} {}"
 
  19 #switch to test libraries
 
  22 # Compile adafruit libraries to bytecode and upload
 
  23 for SUBMODULE in `find . -mindepth 1 -maxdepth 1 -type d `
 
  26     # create adafruit library directories on board
 
  27     find . -mindepth 1 -type d | \
 
  28             grep -v -E "(^./.git.*|__pycache__|^./doc.*|^./example.*)" | \
 
  29             xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay  {}"
 
  30     # compile adafruit library .py files to .mpy
 
  31     find . -type f -name '*.py' | \
 
  32         grep -v -E "(^./conf.py|^./docs/conf.py|^./setup.py|^./example.*)" | \
 
  33         xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
 
  34     # upload adafruit library .mpy files
 
  35     find . -type f -name '*.mpy' | \
 
  36         xargs -n1 -I {} sh -c "echo uploading {} ...; ampy --port ${PORT} put {} {}"