2025-07-03 22:05:38 +02:00

39 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Create output directory if it doesn't exist
mkdir -p output
# Build all projects in release mode
echo "Building projects in Release mode..."
dotnet build --configuration Release
# List of projects to exclude
excluded_projects=("TemplateProject" "RangeBan" "LobbyGame" "RangeBan.Tests" "StatsTracker" "LogEvents")
# Find project directories (containing .csproj files)
echo "Copying DLLs to output folder..."
for proj in $(find . -name "*.csproj"); do
# Extract project name from .csproj file
proj_name=$(basename "$proj" .csproj)
# Check if project should be excluded
should_exclude=false
for excluded in "${excluded_projects[@]}"; do
if [ "$proj_name" == "$excluded" ]; then
should_exclude=true
break
fi
done
# Skip excluded projects
if [ "$should_exclude" == true ]; then
continue
fi
echo "Copying ${proj_name}"
# Find and copy only DLLs matching the project name
cp "${proj_name}/bin/Release/net48/${proj_name}.dll" output/
done
echo "Build and copy completed! DLLs are in the output folder."