diff --git a/app/.Makefile.scripts/make--app-config.sh b/app/.Makefile.scripts/make--app-config.sh index 9b3910c..7a497f0 100755 --- a/app/.Makefile.scripts/make--app-config.sh +++ b/app/.Makefile.scripts/make--app-config.sh @@ -13,11 +13,21 @@ test -n "$LINES" || { test -n "$LINES" || { read -r LINES COLUMNS < <(stty size) } -test -n "$LINES" || { + + +test -z "$LINES" && { LINES=25 - COLUMS=80 +} +test "$LINES" -lt "16" && { + LINES=16 } +test -z "$COLUMNS" && { + COLUMNS=80 +} +test "$COLUMNS" -lt "36" && { + COLUMNS=36 +} type whiptail &>/dev/null && { ECHO(){ diff --git a/app/Makefile b/app/Makefile index 7a67323..642a9c5 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,4 +1,5 @@ -SHELL=/bin/bash +.ONESHELL: +SHELL=/bin/makefile-bash-wrapper.sh # symlink ./app.apk: ./result/app.apk diff --git a/build-android-app.sh b/build-android-app.sh index 865d2d5..af8c4aa 100755 --- a/build-android-app.sh +++ b/build-android-app.sh @@ -32,6 +32,15 @@ ENV BUILD_TOOLS_LATEST="$ANDROID_SDK_ROOT/cmdline-tools/latest" ENV PATH="$BUILD_TOOLS_LATEST/bin:$PATH" ENV LIBRARY_PATH="$LIBRARY_PATH:$BUILD_TOOLS_LATEST/lib" CMD ["make","--trace"] +RUN < /bin/makefile-bash-wrapper.sh << 'WRAPPER' +#!/bin/bash +printf $'\033[0;32m''#----------------------------------------\n'$'\033[0m' >&2 +bash "$@" +printf '\n\n\n\n' >&2 +WRAPPER +chmod u+x /bin/makefile-bash-wrapper.sh +EOF DOCKERFILEEOF } @@ -53,18 +62,10 @@ docker tag $IMAGE build-android-app:latest time $CONTAINERRUNTIME run --name build-android-app-$(date +%F--%H-%M-%S) \ --workdir=/app \ + --env LINES=10 \ + --env COLUMNS=$COLUMNS \ --hostname build-android-app \ --volume ./app:/app \ -it \ --rm \ - "$IMAGE" "$@" | { - test "$#" -eq 0 && { - # colur output in case this script was called without] - # command line arguments - sed 's/^Makefile:/\n\n'$'\033[0;32m''Makefile:'$'\033[0m''/g' - } || { - # no modification else - cat - } - } - + "$IMAGE" "$@"