48 строки
956 B
Bash
Executable File
48 строки
956 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Debug|Release
|
|
CONFIGURATION=Release
|
|
|
|
set -e
|
|
APP_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )/"
|
|
source "$APP_HOME/scripts/.functions.sh"
|
|
|
|
compile() {
|
|
check_dependency_nuget
|
|
check_dependency_msbuild
|
|
|
|
cd $APP_HOME
|
|
header "Downloading dependencies..."
|
|
nuget restore
|
|
|
|
header "Compiling code..."
|
|
msbuild /p:Configuration=$CONFIGURATION
|
|
}
|
|
|
|
run_tests() {
|
|
check_dependency_dotnet
|
|
check_dependency_mono
|
|
|
|
cd $APP_HOME
|
|
header "Running tests..."
|
|
PROJECTS=$(dotnet sln list | grep 'csproj$' | grep '\.Test'| sed s#/.*##)
|
|
for PROJ in $PROJECTS; do
|
|
echo "-- $PROJ"
|
|
mono ./packages/xunit.runner.console.2.2.0/tools/xunit.console.exe $PROJ/bin/Release/$PROJ.dll
|
|
done
|
|
}
|
|
|
|
build_in_sandbox() {
|
|
cd $APP_HOME
|
|
./scripts/build-in-sandbox
|
|
}
|
|
|
|
if [[ "$1" == "--in-sandbox" || "$1" == "-s" ]]; then
|
|
build_in_sandbox
|
|
else
|
|
compile
|
|
run_tests
|
|
fi
|
|
|
|
set +e
|