2017-05-01 04:17:01 +03:00
|
|
|
#!/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() {
|
2017-05-26 04:22:07 +03:00
|
|
|
check_dependency_nuget
|
|
|
|
check_dependency_msbuild
|
|
|
|
|
|
|
|
cd $APP_HOME
|
|
|
|
header "Downloading dependencies..."
|
2017-05-01 04:17:01 +03:00
|
|
|
nuget restore
|
2017-05-26 04:22:07 +03:00
|
|
|
|
|
|
|
header "Compiling code..."
|
|
|
|
msbuild /p:Configuration=$CONFIGURATION
|
2017-05-01 04:17:01 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
run_tests() {
|
2017-05-26 04:22:07 +03:00
|
|
|
check_dependency_dotnet
|
|
|
|
check_dependency_mono
|
|
|
|
|
|
|
|
cd $APP_HOME
|
|
|
|
header "Running tests..."
|
2017-05-01 04:17:01 +03:00
|
|
|
PROJECTS=$(dotnet sln list | grep 'csproj$' | grep '\.Test'| sed s#/.*##)
|
|
|
|
for PROJ in $PROJECTS; do
|
2017-05-26 04:22:07 +03:00
|
|
|
echo "-- $PROJ"
|
2017-05-01 04:17:01 +03:00
|
|
|
mono ./packages/xunit.runner.console.2.2.0/tools/xunit.console.exe $PROJ/bin/Release/$PROJ.dll
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2017-05-26 04:22:07 +03:00
|
|
|
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
|