Something went wrong. Try again.
A free/open-source launcher and vehicle-data platform for aftermarket Android head units.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758#!/usr/bin/env bash# The one command. CI calls this; so do you, and so do agents.# Keeping the logic here rather than in .tangled/workflows keeps the forge replaceable.## ./scripts/check.sh docs + guards + build (if a toolchain is present)# ./scripts/check.sh --no-build docs + guards only (works with no Android SDK)set -uo pipefailcd "$(dirname "$0")/.." || exit 1
MODE="${1:-}"fail=0run() { local name=$1; shift printf '\n==> %s\n' "$name" if "$@"; then return 0; else fail=1; return 1; fi}
run "documentation budgets" ./scripts/check-docs.shrun "pure-module boundary" ./scripts/guards/no-android-in-api.shrun "SPDX headers" ./scripts/guards/spdx-headers.shrun "no binaries in git" ./scripts/guards/no-binaries-in-git.shrun "module graph" ./scripts/guards/module-graph.shif [ -f scripts/guards/licence-checksums.txt ]; then run "licence integrity" bash -c 'sha256sum -c --quiet scripts/guards/licence-checksums.txt'firun "commit-msg hook" ./scripts/guards/commit-hook-selftest.sh
# Preflight the JDK only when we are actually going to build: AGP 8.7 fails late and obscurely# on JDK 22+, and an unhelpful error here costs an agent a whole session.java_ok() { command -v java >/dev/null || { printf ' java not found. Run ./scripts/setup-toolchain.sh\n'; return 1; } local major major=$(java -version 2>&1 | sed -n 's/.*version "\([0-9][0-9]*\).*/\1/p' | head -1) if [ "${major:-0}" -gt 21 ] || [ "${major:-0}" -lt 17 ]; then printf ' java %s is outside the supported range 17-21 (AGP 8.7).\n' "${major:-unknown}" printf ' export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64\n' return 1 fi printf ' java %s OK\n' "$major"}
if [ "$MODE" = "--no-build" ]; then printf '\n==> build: skipped (--no-build)\n'elif [ -x ./gradlew ]; then run "JDK range" java_ok && run "gradle check" ./gradlew checkelif command -v gradle >/dev/null 2>&1; then run "JDK range" java_ok && run "gradle check" gradle checkelse printf '\n==> build: SKIPPED — no ./gradlew yet.\n' printf ' Run ./scripts/setup-toolchain.sh to install the SDK and generate the wrapper.\n'fi
printf '\n'if [ "$fail" -ne 0 ]; then printf 'CHECK FAILED\n'; exit 1fiprintf 'CHECK PASSED\n'