From 8c814a87fa7396aa0cb1b7b98cb31b0fd1815420 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 25 May 2018 17:42:12 +0200 Subject: [PATCH] kaleidoscope-builder: Use a stable build directory Use ./_build/ for the build path by default, and do not delete it at the end of compilation, only when doing a clean. Fixes #315. Signed-off-by: Gergely Nagy --- bin/kaleidoscope-builder | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 58e1b4b7..6dfd0880 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -10,9 +10,11 @@ build_version () { GIT_VERSION="$(cd "$(find_sketch)"; git describe --abbrev=4 --dirty --always)" LIB_VERSION="$(cd "$(find_sketch)"; (grep version= ../../library.properties 2>/dev/null || echo version=0.0.0) | cut -d= -f2)-g${GIT_VERSION}" - BUILD_PATH="${BUILD_PATH:-"$(mktemp -d 2>/dev/null || mktemp -d -t 'build')"}" + BUILD_PATH="$(pwd)/_build/" OUTPUT_DIR="${OUTPUT_DIR:-output/${LIBRARY}}" OUTPUT_PATH="${OUTPUT_PATH:-${SOURCEDIR}/${OUTPUT_DIR}}" + + install -d "${BUILD_PATH}" } build_filenames () { @@ -203,8 +205,6 @@ compile () { if [ "${ARDUINO_VERBOSE}" = "-verbose" ]; then echo "Build artifacts can be found in ${BUILD_PATH}"; - else - rm -rf "${BUILD_PATH}" fi } @@ -263,7 +263,7 @@ decompile () { } clean () { - rm -rf -- "${OUTPUT_PATH}" + rm -rf -- "${OUTPUT_PATH}" "${BUILD_PATH}" } reset_device() {