|
| 1 | +#/bin/bash |
| 2 | + |
| 3 | +# Exit immediately if a command exits with a non-zero status. |
| 4 | +set -e |
| 5 | + |
| 6 | +echo "Starting auto-build script..." |
| 7 | + |
| 8 | + |
| 9 | +function autobuild() |
| 10 | +{ |
| 11 | + # Set environment variables |
| 12 | + BOARDS_AVR="--board uno --board micro --board pro16MHzatmega328 --board pro8MHzatmega328 --board megaatmega2560 --board leonardo" |
| 13 | + BOARDS_ARM="--board due" |
| 14 | + BOARDS_ESP="--board d1_mini --board nodemcuv2 --board lolin_d32" |
| 15 | + |
| 16 | + echo "Build examples/01_Polling..." |
| 17 | + platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP} examples/01_Polling/ErriezMCP23017_Blink/ErriezMCP23017_Blink.ino |
| 18 | + platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP} examples/01_Polling/ErriezMCP23017_BlinkAsynchronous/ErriezMCP23017_BlinkAsynchronous.ino |
| 19 | + platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP} examples/01_Polling/ErriezMCP23017_Button/ErriezMCP23017_Button.ino |
| 20 | + platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP} examples/01_Polling/ErriezMCP23017_Debounce/ErriezMCP23017_Debounce.ino |
| 21 | + platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP} examples/01_Polling/ErriezMCP23017_MultiplePins/ErriezMCP23017_MultiplePins.ino |
| 22 | + platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP} examples/01_Polling/ErriezMCP23017_PinPort/ErriezMCP23017_PinPort.ino |
| 23 | + |
| 24 | + echo "Build examples/02_Interrupt_AVR..." |
| 25 | + platformio ci --lib="." ${BOARDS_AVR} examples/02_Interrupt_AVR/01_ErriezMCP23017_AVR_INT0/01_ErriezMCP23017_AVR_INT0.ino |
| 26 | + platformio ci --lib="." ${BOARDS_AVR} examples/02_Interrupt_AVR/02_ErriezMCP23017_AVR_PCINT/02_ErriezMCP23017_AVR_PCINT.ino |
| 27 | + |
| 28 | + echo "Build examples/03_Interrupt_ESP8266_ESP32..." |
| 29 | + platformio ci --lib="." ${BOARDS_ESP} examples/03_Interrupt_ESP8266_ESP32/01_ErriezMCP23017_ESP8266_ESP32_Interrupt/01_ErriezMCP23017_ESP8266_ESP32_Interrupt.ino |
| 30 | +} |
| 31 | + |
| 32 | +function generate_doxygen() |
| 33 | +{ |
| 34 | + echo "Generate Doxygen HTML..." |
| 35 | + |
| 36 | + DOXYGEN_PDF="ErriezMCP23017.pdf" |
| 37 | + |
| 38 | + # Cleanup |
| 39 | + rm -rf html latex |
| 40 | + |
| 41 | + # Generate Doxygen HTML and Latex |
| 42 | + doxygen Doxyfile |
| 43 | + |
| 44 | + # Allow filenames starting with an underscore |
| 45 | + echo "" > html/.nojekyll |
| 46 | + |
| 47 | + # Generate PDF when script is not running on Travis-CI |
| 48 | + if [[ -z ${TRAVIS_BUILD_DIR} ]]; then |
| 49 | + # Generate Doxygen PDF |
| 50 | + make -C latex |
| 51 | + |
| 52 | + # Copy PDF to root directory |
| 53 | + cp latex/refman.pdf ./${DOXYGEN_PDF} |
| 54 | + fi |
| 55 | +} |
| 56 | + |
| 57 | +autobuild |
| 58 | +generate_doxygen |
0 commit comments