File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,11 @@ function build_pio_sketch(){ # build_pio_sketch <board> <options> <path-to-ino>
18
18
local board=" $1 "
19
19
local options=" $2 "
20
20
local sketch=" $3 "
21
+ local buildFlags=" $4 "
21
22
local sketch_dir=$( dirname " $sketch " )
22
23
echo " "
23
24
echo " Compiling '" $( basename " $sketch " ) " ' ..."
24
- python -m platformio ci -- board " $board " " $sketch_dir " --project-option=" $options " --project-option=" framework=arduino "
25
+ python -m platformio ci -l " . " -- board " $board " " $sketch_dir " --project-option=" $options " --project-option=" build_flags= $buildFlags "
25
26
}
26
27
27
28
function count_sketches(){ # count_sketches <examples-path>
@@ -116,12 +117,18 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
116
117
|| [ -f " $sketchdir /.test.skip" ]; then
117
118
continue
118
119
fi
120
+ local sketchBuildFlags=" "
121
+ if [ -f " $sketchdir /.test.build_flags" ]; then
122
+ while read line; do
123
+ sketchBuildFlags=" $sketchBuildFlags $line "
124
+ done < " $sketchdir /.test.build_flags"
125
+ fi
119
126
sketchnum=$(( $sketchnum + 1 ))
120
127
if [ " $sketchnum " -le " $start_index " ] \
121
128
|| [ " $sketchnum " -gt " $end_index " ]; then
122
129
continue
123
130
fi
124
- build_pio_sketch " $board " " $options " " $sketch "
131
+ build_pio_sketch " $board " " $options " " $sketch " " $sketchBuildFlags "
125
132
local result=$?
126
133
if [ $result -ne 0 ]; then
127
134
return $result
You can’t perform that action at this time.
0 commit comments