Skip to content

Commit

Permalink
Fix #78 Use platformio to build multiple boards
Browse files Browse the repository at this point in the history
  • Loading branch information
4-20ma committed Sep 17, 2016
1 parent 62ed1fe commit f596d02
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 67 deletions.
43 changes: 27 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
language: c
before_install:
- export ARDUINO_VERSION=1.6.5
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget http://downloads.arduino.cc/arduino-${ARDUINO_VERSION}-linux64.tar.xz
- tar xf arduino-${ARDUINO_VERSION}-linux64.tar.xz
- sudo mv arduino-${ARDUINO_VERSION} /usr/local/share/arduino
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
language: python

python:
- 2.7

sudo: false

cache:
directories:
- ~/.platformio

# update Makefile if target boards added
env:
- PLATFORMIO_BOARD=uno
- PLATFORMIO_BOARD=due
- PLATFORMIO_BOARD=huzzah
- PLATFORMIO_BOARD=genuino101
- PLATFORMIO_BOARD=teensy31

install:
- ln -s ${PWD} /usr/local/share/arduino/libraries/ModbusMaster
- arduino --pref "compiler.warning_level=all" --save-prefs
script:
- echo $PWD
- pip install -U platformio

before_script:
- env
- echo $HOME
- echo $TRAVIS_BUILD_DIR
- ls -al $PWD
- source ${TRAVIS_BUILD_DIR}/travis/common.sh
- build_examples

script:
- make build
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#-------------------------------------------------------------------- settings
FIND := find
DIR := $(PWD)/examples
CRITERIA := \( -name "*.ino" -o -name "*.pde" \)
EACH_EXAMPLE := $(FIND) $(DIR) $(CRITERIA) -exec
BUILD := platformio ci
LIB := .

#--------------------------------------------------------------------- targets
# update .travis.yml if target boards added
all: uno due huzzah genuino101 teensy31

uno due huzzah genuino101 teensy31:
PLATFORMIO_BOARD=$@ $(MAKE) build

build:
$(EACH_EXAMPLE) $(BUILD) --board=$(PLATFORMIO_BOARD) --lib=$(LIB) {} \;

.PHONY: all uno due huzzah genuino101 teensy31 build
51 changes: 0 additions & 51 deletions travis/common.sh

This file was deleted.

0 comments on commit f596d02

Please sign in to comment.