image: Ubuntu1804

environment:
  BUILD_HOME: "/home/appveyor"

  TARGET_LIB: "$BUILD_HOME/Arduino/libraries/blinker-library"
  OTHER_LIB: "https://github.com/adafruit/Adafruit_NeoPixel.git,https://github.com/adafruit/DHT-sensor-library.git,https://github.com/adafruit/Adafruit_Sensor.git,https://github.com/adafruit/Adafruit-BMP085-Library.git"

  ARDUINO_VER: "arduino-1.8.9"
  ARDUINO_URL: "https://downloads.arduino.cc/arduino-1.8.9-linux64.tar.xz"

  ARDUINO_PATH: "$BUILD_HOME/$ARDUINO_VER"

  matrix:

  - TARGET: "ESP32"
    LIB_VER: "arduino-esp32-1.0.4"
    LIB_URL: "https://github.com/espressif/arduino-esp32/archive/1.0.4.zip"

    HWLIB_PATH: "$BUILD_HOME/Arduino/hardware/espressif"
    TOOL_PATH:  "$HWLIB_PATH/esp32/tools"

    BOARD_CONF: "espressif:esp32:nodemcu-32s:FlashFreq=80"
    BUILD_CONF: "build.warn_data_percentage=75,runtime.tools.xtensa-esp32-elf-gcc.path=$HWLIB_PATH/esp32/tools/xtensa-esp32-elf,runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=$HWLIB_PATH/esp32/tools/xtensa-esp32-elf,runtime.tools.esptool_py.path=$HWLIB_PATH/esp32/tools/esptool_py/2.6.1,runtime.tools.esptool_py-2.6.1.path=$HWLIB_PATH/esp32/tools/esptool_py/2.6.1,runtime.tools.mkspiffs.path=$HWLIB_PATH/esp32/tools/mkspiffs/0.2.3,runtime.tools.mkspiffs-0.2.3.path=$HWLIB_PATH/esp32/tools/mkspiffs/0.2.3"

  - TARGET: "UNO"
    BOARD_CONF: "arduino:avr:uno"

  - TARGET: "ESP8266"
    LIB_VER: "esp8266-2.5.2"
    LIB_URL: "https://github.com/esp8266/Arduino/releases/download/2.5.2/esp8266-2.5.2.zip"

    HWLIB_PATH: "$BUILD_HOME/Arduino/hardware/esp8266com"
    TOOL_PATH:  "$HWLIB_PATH/esp8266/tools"

    BOARD_CONF: "esp8266com:esp8266:wifiduino:xtal=80,vt=flash,exception=disabled,ssl=all,eesz=4M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600"
    BUILD_CONF: "build.warn_data_percentage=75,runtime.tools.xtensa-lx106-elf-gcc.path=$HWLIB_PATH/esp8266/tools/xtensa-lx106-elf,runtime.tools.xtensa-lx106-elf-gcc-2.5.0-3-20ed2b9.path=$HWLIB_PATH/esp8266/tools/xtensa-lx106-elf,runtime.tools.mkspiffs.path=$HWLIB_PATH/esp8266/tools/mkspiffs,runtime.tools.mkspiffs-2.5.0-3-20ed2b9.path=$HWLIB_PATH/esp8266/tools/mkspiffs,runtime.tools.python.path=$HWLIB_PATH/esp8266/tools/python,runtime.tools.python-3.7.2-post1.path=$HWLIB_PATH/esp8266/tools/python"

init:
- mkdir -p $BUILD_HOME/Arduino/libraries
- mkdir -p $BUILD_HOME/Arduino/hardware
- mkdir -p $BUILD_HOME/build_cache
clone_folder: $TARGET_LIB

install:
- chmod +x $TARGET_LIB/test/install.sh
- chmod +x $TARGET_LIB/test/build.sh
- $TARGET_LIB/test/install.sh

build_script:
- $TARGET_LIB/test/build.sh