1
1
#! /usr/bin/env bash
2
-
2
+ set -x
3
3
# return 1 if this test should not be built in CI (for other archs, not needed, etc.)
4
4
function skip_ino()
5
5
{
@@ -64,11 +64,18 @@ function build_sketches()
64
64
local build_mod=$4
65
65
local build_rem=$5
66
66
local lwip=$6
67
+ export ARDUINO_IDE_PATH=$arduino
67
68
mkdir -p $build_dir
68
69
local build_cmd=" python3 tools/build.py -b generic -v -w all -s 4M1M -v -k --build_cache $cache_dir -p $PWD /$build_dir -n $lwip $build_arg "
70
+ if [ " $WINDOWS " = " 1" ]; then
71
+ # Paths to the arduino builder need to be c:\ referenced, not our native ones
72
+ local pwd_win=$( realpath $PWD | sed ' s/\/c/C:/' )
73
+ local bar_win=$( echo $build_arg | sed ' s/\/c\//C:\//g' )
74
+ export ARDUINO_IDE_PATH=$( realpath $arduino | sed ' s/\/c/C:/' )
75
+ build_cmd=" python3 tools/build.py -b generic -v -w all -s 4M1M -v -k -p $pwd_win /$build_dir -n $lwip $bar_win "
76
+ fi
69
77
local sketches=$( find $srcpath -name * .ino | sort)
70
78
print_size_info > size.log
71
- export ARDUINO_IDE_PATH=$arduino
72
79
local testcnt=0
73
80
for sketch in $sketches ; do
74
81
testcnt=$(( ($testcnt + 1 ) % $build_mod ))
@@ -107,6 +114,9 @@ function build_sketches()
107
114
fi
108
115
echo -e " \n ------------ Building $sketch ------------ \n" ;
109
116
# $arduino --verify $sketch;
117
+ if [ " $WINDOWS " == " 1" ]; then
118
+ sketch=$( echo $sketch | sed ' s/\/c/C:/' )
119
+ fi
110
120
echo " $build_cmd $sketch "
111
121
time ($build_cmd $sketch > build.log)
112
122
local result=$?
@@ -135,7 +145,7 @@ function install_libraries()
135
145
pushd $HOME /Arduino/libraries
136
146
137
147
# install ArduinoJson library
138
- { test -r ArduinoJson-v6.11.0.zip || wget https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip ArduinoJson-v6.11.0.zip
148
+ { test -r ArduinoJson-v6.11.0.zip || wget -nv https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip -q ArduinoJson-v6.11.0.zip
139
149
140
150
popd
141
151
}
@@ -145,13 +155,28 @@ function install_ide()
145
155
local ide_path=$1
146
156
local core_path=$2
147
157
local debug=$3
148
- test -r arduino.tar.xz || wget -O arduino.tar.xz https://www.arduino.cc/download.php? f=/arduino-nightly-linux64.tar.xz
149
- tar xf arduino.tar.xz
158
+ if [ " $WINDOWS " = " 1" ]; then
159
+ # Acquire needed packages from Windows package manager
160
+ choco install --no-progress python3
161
+ export PATH=" /c/Python37:$PATH " # Ensure it's live from now on...
162
+ cp /c/Python37/python.exe /c/Python37/python3.exe
163
+ choco install --no-progress unzip
164
+ choco install --no-progress sed
165
+ test -r arduino-nightly-windows.zip || wget -nv -O arduino-nightly-windows.zip https://www.arduino.cc/download.php? f=/arduino-nightly-windows.zip
166
+ unzip -q arduino-nightly-windows.zip
167
+ else
168
+ test -r arduino.tar.xz || wget -nv -O arduino.tar.xz https://www.arduino.cc/download.php? f=/arduino-nightly-linux64.tar.xz
169
+ tar xf arduino.tar.xz
170
+ fi
150
171
mv arduino-nightly $ide_path
151
172
cd $ide_path /hardware
152
173
mkdir esp8266com
153
174
cd esp8266com
154
- ln -s $core_path esp8266
175
+ if [ " $WINDOWS " = " 1" ]; then
176
+ cp -a $core_path esp8266
177
+ else
178
+ ln -s $core_path esp8266
179
+ fi
155
180
local debug_flags=" "
156
181
if [ " $debug " = " debug" ]; then
157
182
debug_flags=" -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM"
@@ -163,7 +188,7 @@ function install_ide()
163
188
cat esp8266/platform.local.txt
164
189
echo -e " \n----\n"
165
190
cd esp8266/tools
166
- python3 get.py
191
+ python3 get.py -q
167
192
export PATH=" $ide_path :$core_path /tools/xtensa-lx106-elf/bin:$PATH "
168
193
}
169
194
0 commit comments