2015-11-10 12:24:35 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
function build_sketch()
|
|
|
|
{
|
|
|
|
local sketch=$1
|
2017-04-09 18:50:49 +00:00
|
|
|
local binpath=$2
|
|
|
|
mkdir -p binpath
|
2015-11-10 12:24:35 +00:00
|
|
|
# buld sketch with arudino ide
|
|
|
|
echo -e "\n Build $sketch \n"
|
2017-04-09 19:18:07 +00:00
|
|
|
echo -e "\n in $binpath \n"
|
2017-04-09 18:50:49 +00:00
|
|
|
arduino --verbose --verify --pref build.path=$binpath $sketch
|
2015-11-10 12:24:35 +00:00
|
|
|
|
|
|
|
# get build result from arduino
|
|
|
|
local re=$?
|
|
|
|
|
|
|
|
# check result
|
|
|
|
if [ $re -ne 0 ]; then
|
|
|
|
echo "Failed to build $sketch"
|
|
|
|
return $re
|
|
|
|
fi
|
|
|
|
}
|