From 22363ac5724b41a3cb25b82f099021da4b333754 Mon Sep 17 00:00:00 2001 From: Alessio Di Mauro Date: Tue, 17 Jul 2018 12:37:57 +0200 Subject: [PATCH 1/2] Add a LIB_PROPERTIES_PATH option to the build system Add a variable to specify where the "library.properties" file can be found so that the build can include a user-define version number. --- bin/kaleidoscope-builder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 58e1b4b7..91fd349c 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -8,7 +8,8 @@ set -e 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}" + LIB_PROPERTIES_PATH="${LIB_PROPERTIES_PATH:-"../.."}" + LIB_VERSION="$(cd "$(find_sketch)"; (grep version= ${LIB_PROPERTIES_PATH}/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')"}" OUTPUT_DIR="${OUTPUT_DIR:-output/${LIBRARY}}" From 4f2000978287c09cac731b69949a61d3516c7270 Mon Sep 17 00:00:00 2001 From: Alessio Di Mauro Date: Wed, 18 Jul 2018 09:17:00 +0200 Subject: [PATCH 2/2] Add double quotes to keep shellcheck happy --- bin/kaleidoscope-builder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 91fd349c..dd628d6c 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -9,7 +9,7 @@ set -e build_version () { GIT_VERSION="$(cd "$(find_sketch)"; git describe --abbrev=4 --dirty --always)" LIB_PROPERTIES_PATH="${LIB_PROPERTIES_PATH:-"../.."}" - LIB_VERSION="$(cd "$(find_sketch)"; (grep version= ${LIB_PROPERTIES_PATH}/library.properties 2>/dev/null || echo version=0.0.0) | cut -d= -f2)-g${GIT_VERSION}" + LIB_VERSION="$(cd "$(find_sketch)"; (grep version= "${LIB_PROPERTIES_PATH}/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')"}" OUTPUT_DIR="${OUTPUT_DIR:-output/${LIBRARY}}"