Jordandevlog's picture
Upload csharp/scripts/build.sh
914f576 verified
Raw
History Blame Contribute Delete
787 Bytes
#!/usr/bin/env bash
set -euo pipefail
echo "πŸ”¨ Building C# project"
echo "========================"
# Check .NET SDK
if ! command -v dotnet &> /dev/null; then
echo "❌ .NET SDK not found. Install from https://dotnet.microsoft.com/download"
exit 1
fi
DOTNET_VERSION=$(dotnet --version)
echo "βœ“ .NET SDK $DOTNET_VERSION"
# Restore dependencies
echo ""
echo "πŸ“¦ Restoring packages..."
dotnet restore
# Build
echo ""
echo "πŸ”¨ Building..."
dotnet build --no-restore --configuration Release
# Run tests
echo ""
echo "πŸ§ͺ Running tests..."
dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage"
echo ""
echo "βœ… Build and tests complete!"
echo " Release binary: bin/Release/net8.0/"
echo " Coverage report: TestResults/*/coverage.cobertura.xml"