Skip to content

Commit e0aad0f

Browse files
committed
Adjust build dir for tests and sketches
1 parent 86eb776 commit e0aad0f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Diff for: .github/scripts/on-push.sh

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
export ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
6+
57
function build(){
68
local target=$1
79
local fqbn=$2

Diff for: .github/scripts/sketch_utils.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
88
fi
99

1010
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
11-
ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
11+
if [ -z "$ARDUINO_BUILD_DIR" ]; then
12+
build_dir="$(dirname $sketch)/build"
13+
else
14+
build_dir="$ARDUINO_BUILD_DIR"
15+
fi
1216
local ide_path=$1
1317
local usr_path=$2
1418
local fqbn=$3
1519
local sketch=$4
1620
local xtra_opts=$5
1721
local win_opts=$6
1822

19-
rm -rf "$ARDUINO_BUILD_DIR"
20-
mkdir -p "$ARDUINO_BUILD_DIR"
23+
rm -rf "$build_dir"
24+
mkdir -p "$build_dir"
2125
mkdir -p "$ARDUINO_CACHE_DIR"
2226
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
2327
-fqbn=$fqbn \
@@ -29,7 +33,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
2933
-hardware "$usr_path/hardware" \
3034
-libraries "$usr_path/libraries" \
3135
-build-cache "$ARDUINO_CACHE_DIR" \
32-
-build-path "$ARDUINO_BUILD_DIR" \
36+
-build-path "$build_dir" \
3337
$win_opts $xtra_opts "$sketch"
3438
}
3539

0 commit comments

Comments
 (0)