This commit is contained in:
lendry
2026-06-26 20:39:41 +03:00
parent 65abf17421
commit 8805ec327f
6 changed files with 423 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
#!/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