Break out setting our build paths into its own function

Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/591/head
Jesse Vincent 6 years ago
parent 38b4663f00
commit 2ec7f83073

@ -23,6 +23,8 @@ build_version () {
GIT_VERSION="$(cd "$(find_sketch)"; if [ -d .git ]; then echo '-g' && git describe --abbrev=4 --dirty --always; fi)" GIT_VERSION="$(cd "$(find_sketch)"; if [ -d .git ]; then echo '-g' && git describe --abbrev=4 --dirty --always; fi)"
LIB_PROPERTIES_PATH="${LIB_PROPERTIES_PATH:-"../.."}" 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)${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)${GIT_VERSION}"
}
build_paths() {
BUILD_PATH="${BUILD_PATH:-"$(mktemp -d 2>/dev/null || mktemp -d -t 'build')"}" BUILD_PATH="${BUILD_PATH:-"$(mktemp -d 2>/dev/null || mktemp -d -t 'build')"}"
OUTPUT_DIR="${OUTPUT_DIR:-output/${LIBRARY}}" OUTPUT_DIR="${OUTPUT_DIR:-output/${LIBRARY}}"
@ -182,6 +184,7 @@ build () {
compile () { compile () {
build_version build_version
build_paths
build_filenames build_filenames
install -d "${OUTPUT_PATH}" install -d "${OUTPUT_PATH}"

Loading…
Cancel
Save