@@ -28,10 +28,26 @@ export IO_PLATFORMS='declare -A io_platforms=( [zero]="arduino:samd:arduino_zero
28
28
sleep 3
29
29
export DISPLAY=:1.0
30
30
31
- # download and install arduino 1.8.5
32
- wget --quiet https://downloads.arduino.cc/arduino-1.8.5-linux64.tar.xz
33
- tar xf arduino-1.8.5-linux64.tar.xz
34
- mv arduino-1.8.5 $HOME /arduino_ide
31
+ # if .travis.yml does not set version
32
+ if [ -z $ARDUINO_IDE_VERSION ]; then export ARDUINO_IDE_VERSION=" 1.8.5" ; fi
33
+
34
+ # if newer version is requested
35
+ if [ ! -f $HOME /arduino_ide/$ARDUINO_IDE_VERSION ] && [ -f $HOME /arduino_ide/arduino ]; then
36
+ shopt -s extglob
37
+ rm -r -f ! (esp32)
38
+ cd $OLDPWD
39
+ echo " DIFFERENT VERSION OF ARDUINO IDE REQUESTED!"
40
+ fi
41
+
42
+ # if not already cached, download and install arduino 1.8.5
43
+ if [ ! -f $HOME /arduino_ide/arduino ]; then
44
+ echo " DOWNLOADING ARDUINO IDE..."
45
+ wget --quiet https://downloads.arduino.cc/arduino-$ARDUINO_IDE_VERSION -linux64.tar.xz
46
+ echo " UNPACKING ARDUINO IDE..."
47
+ mkdir $HOME /arduino_ide
48
+ tar xf arduino-$ARDUINO_IDE_VERSION -linux64.tar.xz -C $HOME /arduino_ide/ --strip-components=1
49
+ touch $HOME /arduino_ide/$ARDUINO_IDE_VERSION
50
+ fi
35
51
36
52
# move this library to the arduino libraries folder
37
53
ln -s $PWD $HOME /arduino_ide/libraries/Adafruit_Test_Library
@@ -47,48 +63,59 @@ echo "########################################################################";
47
63
# install the due, esp8266, and adafruit board packages
48
64
echo -n " ADD PACKAGE INDEX: "
49
65
DEPENDENCY_OUTPUT=$( arduino --pref " boardsmanager.additional.urls=https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs 2>&1 )
50
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
66
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
51
67
52
68
echo -n " ESP32: "
69
+
70
+ if [ ! -d $HOME /Arduino/hardware/espressif ]; then
53
71
DEPENDENCY_OUTPUT=$( mkdir -p $HOME /Arduino/hardware/espressif &&
54
72
cd $HOME /Arduino/hardware/espressif &&
55
73
git clone https://github.com/espressif/arduino-esp32.git esp32 &&
56
74
cd esp32/tools/ &&
57
75
python get.py &&
58
76
cd $TRAVIS_BUILD_DIR
59
77
)
60
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
78
+ else
79
+ DEPENDENCY_OUTPUT=$( cd $HOME /Arduino/hardware/espressif &&
80
+ git pull origin master &&
81
+ cd esp32/tools/ &&
82
+ python get.py &&
83
+ cd $TRAVIS_BUILD_DIR
84
+ )
85
+ fi
86
+
87
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\xe2\x9c\x96" ; else echo -e " \033[0;32m\xe2\x9c\x93" ; fi
61
88
62
89
echo -n " DUE: "
63
90
DEPENDENCY_OUTPUT=$( arduino --install-boards arduino:sam 2>&1 )
64
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
91
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
65
92
66
93
echo -n " ZERO: "
67
94
DEPENDENCY_OUTPUT=$( arduino --install-boards arduino:samd 2>&1 )
68
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
95
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
69
96
70
97
echo -n " ESP8266: "
71
98
DEPENDENCY_OUTPUT=$( arduino --install-boards esp8266:esp8266 2>&1 )
72
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
99
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
73
100
74
101
echo -n " ADAFRUIT AVR: "
75
102
DEPENDENCY_OUTPUT=$( arduino --install-boards adafruit:avr 2>&1 )
76
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
103
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
77
104
78
105
echo -n " ADAFRUIT SAMD: "
79
106
DEPENDENCY_OUTPUT=$( arduino --install-boards adafruit:samd 2>&1 )
80
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
107
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
81
108
82
109
# install random lib so the arduino IDE grabs a new library index
83
110
# see: https://github.com/arduino/Arduino/issues/3535
84
111
echo -n " UPDATE LIBRARY INDEX: "
85
112
DEPENDENCY_OUTPUT=$( arduino --install-library USBHost > /dev/null 2>&1 )
86
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
113
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
87
114
88
115
# set the maximal compiler warning level
89
116
echo -n " SET BUILD PREFERENCES: "
90
117
DEPENDENCY_OUTPUT=$( arduino --pref " compiler.warning_level=all" --save-prefs 2>&1 )
91
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
118
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
92
119
93
120
# init the json temp var for the current platform
94
121
export PLATFORM_JSON=" "
@@ -163,12 +190,12 @@ function build_platform()
163
190
# notify if the platform switch failed
164
191
if [ $platform_switch -ne 0 ]; then
165
192
# heavy X
166
- echo -e " \xe2\x9c\x96"
193
+ echo -e " \033[0;31m\ xe2\x9c\x96"
167
194
echo $platform_stdout
168
195
exit_code=1
169
196
else
170
197
# heavy checkmark
171
- echo -e " \xe2\x9c\x93"
198
+ echo -e " \033[0;32m\ xe2\x9c\x93"
172
199
fi
173
200
174
201
echo " ########################################################################" ;
@@ -193,7 +220,7 @@ function build_platform()
193
220
# continue to next example if platform switch failed
194
221
if [ $platform_switch -ne 0 ]; then
195
222
# heavy X
196
- echo -e " \xe2\x9c\x96"
223
+ echo -e " \033[0;31m\ xe2\x9c\x96"
197
224
198
225
# add json
199
226
PLATFORM_JSON=" ${PLATFORM_JSON} $( json_sketch 0 $example_file $last_example ) "
@@ -243,7 +270,7 @@ function build_platform()
243
270
if [[ $example =~ \. pde$ ]]; then
244
271
245
272
# heavy X
246
- echo -e " \xe2\x9c\x96"
273
+ echo -e " \033[0;31m\ xe2\x9c\x96"
247
274
248
275
echo -e " -------------------------- DEBUG OUTPUT --------------------------\n"
249
276
echo " PDE EXTENSION. PLEASE UPDATE TO INO"
@@ -272,7 +299,7 @@ function build_platform()
272
299
if [ $? -ne 0 ]; then
273
300
274
301
# heavy X
275
- echo -e " \xe2\x9c\x96"
302
+ echo -e " \033[0;31m\ xe2\x9c\x96"
276
303
277
304
echo -e " ----------------------------- DEBUG OUTPUT -----------------------------\n"
278
305
echo " $build_stdout "
@@ -290,7 +317,7 @@ function build_platform()
290
317
else
291
318
292
319
# heavy checkmark
293
- echo -e " \xe2\x9c\x93"
320
+ echo -e " \033[0;32m\ xe2\x9c\x93"
294
321
295
322
# add json
296
323
PLATFORM_JSON=" ${PLATFORM_JSON} $( json_sketch 1 " $example_file " $last_example ) "
0 commit comments