@@ -28,10 +28,25 @@ 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
+ tar xf arduino-$ARDUINO_IDE_VERSION -linux64.tar.xz -C $HOME /arduino_ide/ --strip-components=1
48
+ touch $HOME /arduino_ide/$ARDUINO_IDE_VERSION
49
+ fi
35
50
36
51
# move this library to the arduino libraries folder
37
52
ln -s $PWD $HOME /arduino_ide/libraries/Adafruit_Test_Library
@@ -47,48 +62,59 @@ echo "########################################################################";
47
62
# install the due, esp8266, and adafruit board packages
48
63
echo -n " ADD PACKAGE INDEX: "
49
64
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
65
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
51
66
52
67
echo -n " ESP32: "
68
+
69
+ if [ ! -d $HOME /Arduino/hardware/espressif ]; then
53
70
DEPENDENCY_OUTPUT=$( mkdir -p $HOME /Arduino/hardware/espressif &&
54
71
cd $HOME /Arduino/hardware/espressif &&
55
72
git clone https://github.com/espressif/arduino-esp32.git esp32 &&
56
73
cd esp32/tools/ &&
57
74
python get.py &&
58
75
cd $TRAVIS_BUILD_DIR
59
76
)
60
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96" ; else echo -e " \xe2\x9c\x93" ; fi
77
+ else
78
+ DEPENDENCY_OUTPUT=$( cd $HOME /Arduino/hardware/espressif &&
79
+ git pull origin master &&
80
+ cd esp32/tools/ &&
81
+ python get.py &&
82
+ cd $TRAVIS_BUILD_DIR
83
+ )
84
+ fi
85
+
86
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\xe2\x9c\x96" ; else echo -e " \033[0;32m\xe2\x9c\x93" ; fi
61
87
62
88
echo -n " DUE: "
63
89
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
90
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
65
91
66
92
echo -n " ZERO: "
67
93
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
94
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
69
95
70
96
echo -n " ESP8266: "
71
97
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
98
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
73
99
74
100
echo -n " ADAFRUIT AVR: "
75
101
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
102
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
77
103
78
104
echo -n " ADAFRUIT SAMD: "
79
105
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
106
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
81
107
82
108
# install random lib so the arduino IDE grabs a new library index
83
109
# see: https://github.com/arduino/Arduino/issues/3535
84
110
echo -n " UPDATE LIBRARY INDEX: "
85
111
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
112
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
87
113
88
114
# set the maximal compiler warning level
89
115
echo -n " SET BUILD PREFERENCES: "
90
116
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
117
+ if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
92
118
93
119
# init the json temp var for the current platform
94
120
export PLATFORM_JSON=" "
@@ -163,12 +189,12 @@ function build_platform()
163
189
# notify if the platform switch failed
164
190
if [ $platform_switch -ne 0 ]; then
165
191
# heavy X
166
- echo -e " \xe2\x9c\x96"
192
+ echo -e " \033[0;31m\ xe2\x9c\x96"
167
193
echo $platform_stdout
168
194
exit_code=1
169
195
else
170
196
# heavy checkmark
171
- echo -e " \xe2\x9c\x93"
197
+ echo -e " \033[0;32m\ xe2\x9c\x93"
172
198
fi
173
199
174
200
echo " ########################################################################" ;
@@ -193,7 +219,7 @@ function build_platform()
193
219
# continue to next example if platform switch failed
194
220
if [ $platform_switch -ne 0 ]; then
195
221
# heavy X
196
- echo -e " \xe2\x9c\x96"
222
+ echo -e " \033[0;31m\ xe2\x9c\x96"
197
223
198
224
# add json
199
225
PLATFORM_JSON=" ${PLATFORM_JSON} $( json_sketch 0 $example_file $last_example ) "
@@ -243,7 +269,7 @@ function build_platform()
243
269
if [[ $example =~ \. pde$ ]]; then
244
270
245
271
# heavy X
246
- echo -e " \xe2\x9c\x96"
272
+ echo -e " \033[0;31m\ xe2\x9c\x96"
247
273
248
274
echo -e " -------------------------- DEBUG OUTPUT --------------------------\n"
249
275
echo " PDE EXTENSION. PLEASE UPDATE TO INO"
@@ -272,7 +298,7 @@ function build_platform()
272
298
if [ $? -ne 0 ]; then
273
299
274
300
# heavy X
275
- echo -e " \xe2\x9c\x96"
301
+ echo -e " \033[0;31m\ xe2\x9c\x96"
276
302
277
303
echo -e " ----------------------------- DEBUG OUTPUT -----------------------------\n"
278
304
echo " $build_stdout "
@@ -290,7 +316,7 @@ function build_platform()
290
316
else
291
317
292
318
# heavy checkmark
293
- echo -e " \xe2\x9c\x93"
319
+ echo -e " \033[0;32m\ xe2\x9c\x93"
294
320
295
321
# add json
296
322
PLATFORM_JSON=" ${PLATFORM_JSON} $( json_sketch 1 " $example_file " $last_example ) "
0 commit comments