-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
67 lines (59 loc) · 2.98 KB
/
Copy pathsetup.sh
File metadata and controls
67 lines (59 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
# =============================================================================
# setup.sh — One-shot environment setup for OpenCoroutineProxy
#
# Run this once after cloning the repository. It generates the Gradle wrapper
# binary (gradlew + gradle-wrapper.jar) which is required for all subsequent
# build commands.
#
# Prerequisites:
# - Gradle 8.x installed → https://gradle.org/install/
# - Java 21+ → https://adoptium.net/
# - Docker (optional) → https://docs.docker.com/get-docker/
# =============================================================================
set -euo pipefail
ok() { echo "[OK] $*"; }
info() { echo "[INFO] $*"; }
err() { echo "[ERR] $*" >&2; exit 1; }
echo "============================================="
echo " OpenCoroutineProxy — Environment Setup"
echo "============================================="
# ── Java check ─────────────────────────────────────────────────────────────────
if ! command -v java &>/dev/null; then
err "Java not found. Install Java 21+ from https://adoptium.net/"
fi
JAVA_VERSION=$(java -version 2>&1 | head -1 | grep -oP '(?<=version ")[^"]+')
info "Java version: $JAVA_VERSION"
# ── Gradle wrapper generation ──────────────────────────────────────────────────
if ! command -v gradle &>/dev/null; then
err "Gradle not found. Install from https://gradle.org/install/ then re-run this script."
fi
info "Generating Gradle wrapper (version 8.8)..."
gradle wrapper --gradle-version 8.8 --distribution-type bin
chmod +x gradlew
ok "Gradle wrapper generated — you can now use ./gradlew instead of gradle"
# ── Dependency pre-fetch ───────────────────────────────────────────────────────
info "Pre-fetching dependencies (this may take a minute on first run)..."
./gradlew dependencies --no-daemon --quiet 2>/dev/null && ok "Dependencies downloaded" || true
# ── Docker check (optional) ───────────────────────────────────────────────────
if command -v docker &>/dev/null; then
ok "Docker found: $(docker --version)"
else
info "Docker not found — Docker-based tests (make docker-test) will not be available"
fi
echo
echo "============================================="
echo " Setup complete. Next steps:"
echo ""
echo " Run unit + integration tests:"
echo " ./gradlew test"
echo ""
echo " Run the proxy locally:"
echo " ./gradlew bootRun"
echo ""
echo " Full Docker test pipeline:"
echo " make docker-test"
echo ""
echo " Gatling load test (proxy must be running):"
echo " make load-test"
echo "============================================="