diff --git a/app/.Makefile.scripts/Makefile.android-sdk.sh b/app/.Makefile.scripts/Makefile.android-sdk.sh index 6d0eb52..d46b5d3 100755 --- a/app/.Makefile.scripts/Makefile.android-sdk.sh +++ b/app/.Makefile.scripts/Makefile.android-sdk.sh @@ -1,15 +1,20 @@ #!/bin/bash set -x -. app-config.sh -type sdkmanager 2>/dev/null || { +# get configuration +source app-config.sh + + +# in case needed download and install `sdkmanager` +type sdkmanager 2>/dev/null || ( BUILD_TOOLS="$(realpath -m "$BUILD_TOOLS_LATEST/..")" mkdir -p "$BUILD_TOOLS" cd "$BUILD_TOOLS" for LATESTTOOLS in \ - "$(curl https://developer.android.com/studio#command-line-tools-only | grep -e 'https://dl.google.com/android/repository/commandlinetools-linux-.*_latest.zip' | cut -f2 -d'"')" \ - 'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip' ;\ + "$(curl 'https://developer.android.com/studio#command-line-tools-only' | + grep -e 'https://dl.google.com/android/repository/commandlinetools-linux-.*_latest.zip' | cut -f2 -d'"')" \ + 'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip' do echo "testing to get '$LATESTTOOLS'" echo test "${LATESTTOOLS:0:22}" = "https://dl.google.com/" -a "${LATESTTOOLS:(-11)}" = "_latest.zip" @@ -22,12 +27,12 @@ type sdkmanager 2>/dev/null || { echo "error downloading working cmdline-tools.zip" exit 1 } - done;\ + done ls ls cmdline-tools - rm cmdline-tools.zip;\ + rm cmdline-tools.zip mv -v cmdline-tools "$BUILD_TOOLS_LATEST" || true -} +) test -f android-sdk/.installed.buildtools.version.$APP_VERSION_SDK_TARGET || { EXACTVERSION_BUILDTOOLS="$(