device-simulation-dotnet/scripts/build

48 строки
956 B
Plaintext
Исходник Обычный вид История

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() {
check_dependency_nuget
check_dependency_msbuild
cd $APP_HOME
header "Downloading dependencies..."
2017-05-01 04:17:01 +03:00
nuget restore
header "Compiling code..."
msbuild /p:Configuration=$CONFIGURATION
2017-05-01 04:17:01 +03:00
}
run_tests() {
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
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
}
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