@@ -28,95 +28,114 @@ 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
+ # define colors
32
+ GRAY=' \033[1;30m' ; RED=' \033[0;31m' ; LRED=' \033[1;31m' ; GREEN=' \033[0;32m' ; LGREEN=' \033[1;32m' ; ORANGE=' \033[0;33m' ; YELLOW=' \033[1;33m' ; BLUE=' \033[0;34m' ; LBLUE=' \033[1;34m' ; PURPLE=' \033[0;35m' ; LPURPLE=' \033[1;35m' ; CYAN=' \033[0;36m' ; LCYAN=' \033[1;36m' ; LGRAY=' \033[0;37m' ; WHITE=' \033[1;37m' ;
33
+
34
+ echo -e " \n########################################################################" ;
35
+ echo -e " ${YELLOW} INSTALLING ARDUINO IDE"
36
+ echo " ########################################################################" ;
37
+
31
38
# if .travis.yml does not set version
32
- if [ -z $ARDUINO_IDE_VERSION ]; then export ARDUINO_IDE_VERSION=" 1.8.5" ; fi
39
+ if [ -z $ARDUINO_IDE_VERSION ]; then
40
+ export ARDUINO_IDE_VERSION=" 1.8.5"
41
+ echo " NOTE: YOUR .TRAVIS.YML DOES NOT SPECIFY ARDUINO IDE VERSION, USING $ARDUINO_IDE_VERSION "
42
+ fi
33
43
34
44
# if newer version is requested
35
45
if [ ! -f $HOME /arduino_ide/$ARDUINO_IDE_VERSION ] && [ -f $HOME /arduino_ide/arduino ]; then
46
+ echo -n " DIFFERENT VERSION OF ARDUINO IDE REQUESTED: "
36
47
shopt -s extglob
37
48
cd $HOME /arduino_ide/
38
49
rm -r -f ! (esp32)
50
+ if [ $? -ne 0 ]; then echo -e " " " $RED " " \xe2\x9c\x96" ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
39
51
cd $OLDPWD
40
- echo " DIFFERENT VERSION OF ARDUINO IDE REQUESTED!"
41
52
fi
42
53
43
- # if not already cached, download and install arduino 1.8.5
54
+ # if not already cached, download and install arduino IDE
55
+ echo -n " ARDUINO IDE STATUS: "
44
56
if [ ! -f $HOME /arduino_ide/arduino ]; then
45
- echo " DOWNLOADING ARDUINO IDE... "
57
+ echo -n " DOWNLOADING: "
46
58
wget --quiet https://downloads.arduino.cc/arduino-$ARDUINO_IDE_VERSION -linux64.tar.xz
47
- echo " UNPACKING ARDUINO IDE..."
48
- mkdir $HOME /arduino_ide
59
+ if [ $? -ne 0 ]; then echo -e " " " $RED " " \xe2\x9c\x96" ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
60
+ echo -n " UNPACKING ARDUINO IDE: "
61
+ [ ! -d $HOME /arduino_ide/ ] && mkdir $HOME /arduino_ide
49
62
tar xf arduino-$ARDUINO_IDE_VERSION -linux64.tar.xz -C $HOME /arduino_ide/ --strip-components=1
63
+ if [ $? -ne 0 ]; then echo -e " " " $RED " " \xe2\x9c\x96" ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
50
64
touch $HOME /arduino_ide/$ARDUINO_IDE_VERSION
65
+ else
66
+ echo -n " CACHED: "
67
+ echo -e " " " $GREEN " " \xe2\x9c\x93"
51
68
fi
52
69
53
- # move this library to the arduino libraries folder
54
- ln -s $PWD $HOME /arduino_ide/libraries/Adafruit_Test_Library
70
+ # link test library folder to the arduino libraries folder
71
+ ln -s $TRAVIS_BUILD_DIR $HOME /arduino_ide/libraries/Adafruit_Test_Library
55
72
56
73
# add the arduino CLI to our PATH
57
74
export PATH=" $HOME /arduino_ide:$PATH "
58
75
59
76
echo -e " \n########################################################################" ;
60
- echo " INSTALLING DEPENDENCIES"
77
+ echo -e " ${YELLOW} INSTALLING DEPENDENCIES"
61
78
echo " ########################################################################" ;
62
79
63
80
64
81
# install the due, esp8266, and adafruit board packages
65
82
echo -n " ADD PACKAGE INDEX: "
66
83
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 )
67
- if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
84
+ if [ $? -ne 0 ]; then echo -e " " " $RED " " \ xe2\x9c\x96" ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
68
85
69
86
echo -n " ESP32: "
70
87
71
88
if [ ! -d $HOME /Arduino/hardware/espressif ]; then
72
89
DEPENDENCY_OUTPUT=$( mkdir -p $HOME /Arduino/hardware/espressif &&
73
90
cd $HOME /Arduino/hardware/espressif &&
74
- git clone https://github.com/espressif/arduino-esp32.git esp32 &&
91
+ echo -n " DOWNLOADING: " &&
92
+ git clone https://github.com/espressif/arduino-esp32.git esp32 -q &&
75
93
cd esp32/tools/ &&
76
94
python get.py &&
77
95
cd $TRAVIS_BUILD_DIR
78
96
)
79
97
else
80
98
DEPENDENCY_OUTPUT=$( cd $HOME /Arduino/hardware/espressif &&
81
- git pull origin master &&
99
+ echo -n " UPDATING: " &&
100
+ git pull origin master -q &&
82
101
cd esp32/tools/ &&
83
102
python get.py &&
84
103
cd $TRAVIS_BUILD_DIR
85
104
)
86
105
fi
87
106
88
- if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
107
+ if [ $? -ne 0 ]; then echo -e " " " $RED " " \ xe2\x9c\x96" ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
89
108
90
109
echo -n " DUE: "
91
110
DEPENDENCY_OUTPUT=$( arduino --install-boards arduino:sam 2>&1 )
92
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
111
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 OR CACHED " ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
93
112
94
113
echo -n " ZERO: "
95
114
DEPENDENCY_OUTPUT=$( arduino --install-boards arduino:samd 2>&1 )
96
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
115
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 OR CACHED " ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
97
116
98
117
echo -n " ESP8266: "
99
118
DEPENDENCY_OUTPUT=$( arduino --install-boards esp8266:esp8266 2>&1 )
100
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
119
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 OR CACHED " ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
101
120
102
121
echo -n " ADAFRUIT AVR: "
103
122
DEPENDENCY_OUTPUT=$( arduino --install-boards adafruit:avr 2>&1 )
104
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
123
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 OR CACHED " ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
105
124
106
125
echo -n " ADAFRUIT SAMD: "
107
126
DEPENDENCY_OUTPUT=$( arduino --install-boards adafruit:samd 2>&1 )
108
- if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 or cached " ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
127
+ if [ $? -ne 0 ]; then echo -e " \xe2\x9c\x96 OR CACHED " ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
109
128
110
129
# install random lib so the arduino IDE grabs a new library index
111
130
# see: https://github.com/arduino/Arduino/issues/3535
112
131
echo -n " UPDATE LIBRARY INDEX: "
113
132
DEPENDENCY_OUTPUT=$( arduino --install-library USBHost > /dev/null 2>&1 )
114
- if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
133
+ if [ $? -ne 0 ]; then echo -e " " " $RED " " \ xe2\x9c\x96" ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
115
134
116
135
# set the maximal compiler warning level
117
136
echo -n " SET BUILD PREFERENCES: "
118
137
DEPENDENCY_OUTPUT=$( arduino --pref " compiler.warning_level=all" --save-prefs 2>&1 )
119
- if [ $? -ne 0 ]; then echo -e " \033[0;31m\ xe2\x9c\x96" ; else echo -e " \033[0;32m \xe2\x9c\x93" ; fi
138
+ if [ $? -ne 0 ]; then echo -e " " " $RED " " \ xe2\x9c\x96" ; else echo -e " " " $GREEN " " \xe2\x9c\x93" ; fi
120
139
121
140
# init the json temp var for the current platform
122
141
export PLATFORM_JSON=" "
@@ -177,7 +196,7 @@ function build_platform()
177
196
178
197
echo -e " \n########################################################################" ;
179
198
180
- echo -n " SWITCHING TO ${platform_key} : "
199
+ echo -e - n " ${YELLOW} SWITCHING TO ${platform_key} : "
181
200
182
201
# switch to the requested board.
183
202
# we have to avoid reading the exit code of local:
@@ -191,12 +210,12 @@ function build_platform()
191
210
# notify if the platform switch failed
192
211
if [ $platform_switch -ne 0 ]; then
193
212
# heavy X
194
- echo -e " \033[0;31m \xe2\x9c\x96"
213
+ echo -e " " " $RED " " \xe2\x9c\x96"
195
214
echo $platform_stdout
196
215
exit_code=1
197
216
else
198
217
# heavy checkmark
199
- echo -e " \033[0;32m \xe2\x9c\x93"
218
+ echo -e " " " $GREEN " " \xe2\x9c\x93"
200
219
fi
201
220
202
221
echo " ########################################################################" ;
@@ -221,7 +240,7 @@ function build_platform()
221
240
# continue to next example if platform switch failed
222
241
if [ $platform_switch -ne 0 ]; then
223
242
# heavy X
224
- echo -e " \033[0;31m \xe2\x9c\x96"
243
+ echo -e " " " $RED " " \xe2\x9c\x96"
225
244
226
245
# add json
227
246
PLATFORM_JSON=" ${PLATFORM_JSON} $( json_sketch 0 $example_file $last_example ) "
@@ -271,10 +290,10 @@ function build_platform()
271
290
if [[ $example =~ \. pde$ ]]; then
272
291
273
292
# heavy X
274
- echo -e " \033[0;31m \xe2\x9c\x96"
293
+ echo -e " " " $RED " " \xe2\x9c\x96"
275
294
276
295
echo -e " -------------------------- DEBUG OUTPUT --------------------------\n"
277
- echo " PDE EXTENSION. PLEASE UPDATE TO INO"
296
+ echo " ${LRED} PDE EXTENSION. PLEASE UPDATE TO INO"
278
297
echo -e " \n------------------------------------------------------------------\n"
279
298
280
299
# add json
@@ -300,7 +319,7 @@ function build_platform()
300
319
if [ $? -ne 0 ]; then
301
320
302
321
# heavy X
303
- echo -e " \033[0;31m \xe2\x9c\x96"
322
+ echo -e " " " $RED " " \xe2\x9c\x96"
304
323
305
324
echo -e " ----------------------------- DEBUG OUTPUT -----------------------------\n"
306
325
echo " $build_stdout "
@@ -318,7 +337,7 @@ function build_platform()
318
337
else
319
338
320
339
# heavy checkmark
321
- echo -e " \033[0;32m \xe2\x9c\x93"
340
+ echo -e " " " $GREEN " " \xe2\x9c\x93"
322
341
323
342
# add json
324
343
PLATFORM_JSON=" ${PLATFORM_JSON} $( json_sketch 1 " $example_file " $last_example ) "
@@ -646,5 +665,4 @@ function json_main_platforms()
646
665
647
666
echo -e " ||||||||||||||||||||||||||||| JSON STATUS ||||||||||||||||||||||||||||||\n"
648
667
649
- }
650
-
668
+ }
0 commit comments