Bundle AndroidX, Kotlin Gradle plugin, and SDK patch scripts so Gradle no longer needs Google Maven at runtime. Bake Gradle wrapper into Docker image during build when network is available. Co-authored-by: Cursor <cursoragent@cursor.com>
14 lines
516 B
Bash
14 lines
516 B
Bash
#!/usr/bin/env bash
|
|
# Download Gradle wrapper distribution for offline Docker/APK builds.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
GRADLE_VERSION="${GRADLE_VERSION:-8.14.3}"
|
|
DEST="${ROOT}/docker/offline-gradle"
|
|
ZIP="${DEST}/gradle-${GRADLE_VERSION}-bin.zip"
|
|
URL="https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip"
|
|
|
|
mkdir -p "${DEST}"
|
|
curl -fsSL "${URL}" -o "${ZIP}"
|
|
echo "==> Gradle ${GRADLE_VERSION} saved to ${ZIP} ($(du -h "${ZIP}" | awk '{print $1}'))"
|