Monorepo: Gitea CI, docs, auth/sync, backend APIs, gitignore
- Add Gitea Actions workflow; point README to gitea.d-bis.org/Sankofa_Phoenix/SMOA - Expand .gitignore for Spring H2 data, secrets, Kotlin .kotlin/, tooling - Track docs/api/generated ReDoc bundle; refresh api docs README - Android: network/auth/sync, UI shell, tests; backend credentials/integrity APIs - Docs, scripts (generate-api-docs), modules and core updates Made-with: Cursor
This commit is contained in:
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run backend tests and Android debug build. Requires JDK 17 and Android SDK.
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
exec ./gradlew smoaVerify --no-daemon "$@"
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Export OpenAPI JSON from a running SMOA backend (default http://localhost:8080).
|
||||
# Usage: ./scripts/export-openapi-local.sh [BASE_URL] [OUTPUT_PATH]
|
||||
set -euo pipefail
|
||||
BASE="${1:-http://localhost:8080}"
|
||||
OUT="${2:-openapi-export.json}"
|
||||
curl -sSf "${BASE%/}/v3/api-docs" -o "$OUT"
|
||||
echo "Wrote $OUT"
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerates static API browser under docs/api/generated (ReDoc + spec path).
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
GEN="$ROOT/docs/api/generated"
|
||||
SPEC_SRC="$ROOT/docs/api/api-specification.yaml"
|
||||
mkdir -p "$GEN"
|
||||
if [[ -f "$SPEC_SRC" ]]; then
|
||||
cp -f "$SPEC_SRC" "$GEN/api-specification.yaml"
|
||||
fi
|
||||
cat > "$GEN/index.html" << 'HTMLEOF'
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>SMOA API — ReDoc</title>
|
||||
<style>body { margin: 0; }</style>
|
||||
</head>
|
||||
<body>
|
||||
<redoc spec-url="./api-specification.yaml"></redoc>
|
||||
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
HTMLEOF
|
||||
echo "Wrote $GEN/index.html and copied spec (if present)."
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run in Ubuntu WSL after: usbipd attach --wsl --busid <BUSID> (Windows Admin PowerShell)
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
APK="$ROOT/app/build/outputs/apk/debug/app-debug.apk"
|
||||
export PATH="${HOME}/Android/Sdk/platform-tools:${PATH}"
|
||||
export ADB_INSTALL_TIMEOUT="${ADB_INSTALL_TIMEOUT:-3600}"
|
||||
|
||||
echo "=== lsusb (expect Samsung / 04e8) ==="
|
||||
lsusb || true
|
||||
|
||||
adb kill-server || true
|
||||
sleep 1
|
||||
echo "=== adb devices ==="
|
||||
adb devices
|
||||
|
||||
WAIT_MAX="${WAIT_FOR_DEVICE_SECS:-180}"
|
||||
elapsed=0
|
||||
while ! adb devices 2>/dev/null | grep -q $'\tdevice$'; do
|
||||
if adb devices 2>/dev/null | grep -q $'\tunauthorized$'; then
|
||||
echo "Unauthorized — unlock the phone and tap Allow on the USB debugging (RSA) prompt..."
|
||||
else
|
||||
echo "No device — run usbipd attach (Windows), check cable/USB mode..."
|
||||
fi
|
||||
if (( elapsed >= WAIT_MAX )); then
|
||||
echo "Timed out after ${WAIT_MAX}s waiting for device." >&2
|
||||
adb devices
|
||||
exit 1
|
||||
fi
|
||||
sleep 5
|
||||
elapsed=$((elapsed + 5))
|
||||
# After you tap Allow, reconnecting ADB often flips unauthorized → device.
|
||||
adb kill-server 2>/dev/null || true
|
||||
sleep 1
|
||||
done
|
||||
echo "=== adb devices (ready) ==="
|
||||
adb devices
|
||||
|
||||
cd "$ROOT"
|
||||
if [[ ! -f "$APK" ]]; then
|
||||
echo "=== building debug APK ==="
|
||||
./gradlew :app:assembleDebug --no-daemon
|
||||
fi
|
||||
|
||||
echo "=== adb install (large APK over usbip can take many minutes) ==="
|
||||
# --streaming avoids a separate full-file sync that often EOFs over USB/IP.
|
||||
if ! adb install -r -d --streaming "$APK"; then
|
||||
echo "Streaming install failed; retrying without --streaming..." >&2
|
||||
adb install -r -d "$APK"
|
||||
fi
|
||||
echo "=== verify ==="
|
||||
adb shell pm path com.smoa
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user