This commit is contained in:
master
2026-02-04 19:59:20 +02:00
parent 557feefdc3
commit 5548cf83bf
1479 changed files with 53557 additions and 40339 deletions

View File

@@ -0,0 +1,82 @@
#!/usr/bin/env bash
#
# Build (and optionally test) all module solutions under src/.
#
# Usage:
# ./scripts/build-all-solutions.sh # build only
# ./scripts/build-all-solutions.sh --test # build + test
# ./scripts/build-all-solutions.sh --test --configuration Release
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SRC_DIR="$REPO_ROOT/src"
RUN_TESTS=false
CONFIGURATION="Debug"
while [[ $# -gt 0 ]]; do
case "$1" in
--test|-t) RUN_TESTS=true; shift ;;
--configuration|-c) CONFIGURATION="$2"; shift 2 ;;
*) echo "Unknown option: $1" >&2; exit 1 ;;
esac
done
# Discover solutions (exclude root StellaOps.sln)
mapfile -t SOLUTIONS < <(find "$SRC_DIR" -name '*.sln' ! -name 'StellaOps.sln' | sort)
if [[ ${#SOLUTIONS[@]} -eq 0 ]]; then
echo "ERROR: No solution files found under src/." >&2
exit 1
fi
echo "Found ${#SOLUTIONS[@]} solution(s) to build."
echo ""
build_pass=()
build_fail=()
test_pass=()
test_fail=()
for sln in "${SOLUTIONS[@]}"; do
rel="${sln#"$REPO_ROOT/"}"
echo "--- BUILD: $rel ---"
if dotnet build "$sln" --configuration "$CONFIGURATION" --nologo -v quiet; then
build_pass+=("$rel")
else
build_fail+=("$rel")
echo " FAILED"
continue
fi
if $RUN_TESTS; then
echo "--- TEST: $rel ---"
if dotnet test "$sln" --configuration "$CONFIGURATION" --nologo --no-build -v quiet; then
test_pass+=("$rel")
else
test_fail+=("$rel")
echo " TEST FAILED"
fi
fi
done
echo ""
echo "========== Summary =========="
echo "Build passed : ${#build_pass[@]}"
if [[ ${#build_fail[@]} -gt 0 ]]; then
echo "Build failed : ${#build_fail[@]}"
for f in "${build_fail[@]}"; do echo " - $f"; done
fi
if $RUN_TESTS; then
echo "Test passed : ${#test_pass[@]}"
if [[ ${#test_fail[@]} -gt 0 ]]; then
echo "Test failed : ${#test_fail[@]}"
for f in "${test_fail[@]}"; do echo " - $f"; done
fi
fi
if [[ ${#build_fail[@]} -gt 0 ]] || [[ ${#test_fail[@]} -gt 0 ]]; then
exit 1
fi