#!/bin/bash -e

# Download and extract the HERE SDK.
curl -s -S -o HERE_SDK.zip "$HERE_SDK_URL"
unzip -j -d 'HERE_SDK' -o 'HERE_SDK.zip'
unzip -j 'HERE_SDK/HERE-sdk.zip' 'HERE-sdk/libs/HERE-sdk.aar' -d 'HERE_SDK'
rm 'HERE_SDK.zip'

# Find paths that contain an app module
APP_PROJECTS=$(find "$PWD" -maxdepth 1 -type d -exec [ -d {}/app/libs ] \; -print -prune)

for APP_PATH in $APP_PROJECTS; do
    cp 'HERE_SDK/HERE-sdk.aar' "$APP_PATH/app/libs"
done

rm -rf 'HERE_SDK'

#!/bin/bash -e

# Download and extract the HERE SDK.
curl -s -S -o HERE_SDK.zip "$HERE_SDK_URL"

# Extract the downloaded outer ZIP file.
unzip -j -o 'HERE_SDK.zip' -d 'HERE_SDK'

# Extract the contained inner ZIP.
unzip -j -o 'HERE_SDK/HERE-sdk.zip' 'sdk/HERE-sdk/libs/HERE-sdk.aar' -d 'HERE_SDK'

# Find paths that contain an app module
APP_PROJECTS=$(find "$PWD" -maxdepth 1 -type d -exec [ -d {}/app/libs ] \; -print -prune)

for APP_PATH in $APP_PROJECTS; do
    cp 'HERE_SDK/HERE-sdk.aar' "$APP_PATH/app/libs"
done

rm -rf 'HERE_SDK'
rm -f 'HERE_SDK.zip'

Fix the path to HERE-sdk.aar upon extracting
ci: Fix the path to HERE-sdk.aar upon extracting
