Files
IdP/tauri_app/docker/populate-offline-agp.sh
lendry 8805ec327f fix
2026-06-26 20:39:41 +03:00

36 lines
1.2 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Download Android Gradle Plugin into tauri_app/docker/offline-maven for offline Docker builds.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
AGP_VERSION="${ANDROID_GRADLE_PLUGIN_VERSION:-8.11.0}"
DEST="${ROOT}/docker/offline-maven/com/android/tools/build/gradle/${AGP_VERSION}"
mkdir -p "${DEST}"
try_download() {
local base_url="$1"
if curl -fsSL --connect-timeout 20 --max-time 120 \
"${base_url}/com/android/tools/build/gradle/${AGP_VERSION}/gradle-${AGP_VERSION}.pom" \
-o "${DEST}/gradle-${AGP_VERSION}.pom"; then
curl -fsSL --connect-timeout 20 --max-time 600 \
"${base_url}/com/android/tools/build/gradle/${AGP_VERSION}/gradle-${AGP_VERSION}.jar" \
-o "${DEST}/gradle-${AGP_VERSION}.jar"
echo "==> AGP ${AGP_VERSION} saved to ${DEST} (source: ${base_url})"
return 0
fi
return 1
}
for base in \
"https://maven.google.com" \
"https://dl.google.com/android/maven2" \
"https://dl.google.com/dl/android/maven2"; do
if try_download "${base}"; then
exit 0
fi
done
echo "Не удалось скачать AGP ${AGP_VERSION}. Проверьте доступ к Google Maven." >&2
exit 1